Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcaustin2011-11-30 15:35:18 +0000
committercaustin2011-11-30 15:35:18 +0000
commit14d1d9f99bd46c89562ab8552d69c8f13f470465 (patch)
tree33822fa17566598a27d39ec8f0a3a9c9744839f9 /org.eclipse.help.webapp
parent7237dea927aed210a7f6bb4e8d4989962880da7d (diff)
downloadeclipse.platform.ua-14d1d9f99bd46c89562ab8552d69c8f13f470465.tar.gz
eclipse.platform.ua-14d1d9f99bd46c89562ab8552d69c8f13f470465.tar.xz
eclipse.platform.ua-14d1d9f99bd46c89562ab8552d69c8f13f470465.zip
Bug 351072 - [Help][Search] If search word contains ":" then click on av20111130-1535
search result shows empty page
Diffstat (limited to 'org.eclipse.help.webapp')
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/EclipseConnector.java49
1 files changed, 14 insertions, 35 deletions
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/EclipseConnector.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/EclipseConnector.java
index 2e2006ff7..d066cb367 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/EclipseConnector.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/EclipseConnector.java
@@ -72,10 +72,18 @@ public class EclipseConnector {
public void transfer(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
+
+ // URL
+ String pathInfo = req.getPathInfo();
+ if (pathInfo == null)
+ return;
+ if (pathInfo.startsWith("/")) //$NON-NLS-1$
+ pathInfo = pathInfo.substring(1);
+ String query = req.getQueryString();
+ String url = query == null ? pathInfo : (pathInfo + "?" + query); //$NON-NLS-1$
+
try {
- String url = getURL(req);
- if (url == null)
- return;
+
//System.out.println("Transfer " + url); //$NON-NLS-1$
// Redirect if the request includes PLUGINS_ROOT and is not a content request
int index = url.lastIndexOf(HelpURLConnection.PLUGINS_ROOT);
@@ -94,9 +102,8 @@ public class EclipseConnector {
if (lowerCaseuRL.startsWith("jar:") //$NON-NLS-1$
|| lowerCaseuRL.startsWith("platform:") //$NON-NLS-1$
|| (lowerCaseuRL.startsWith("file:") && UrlUtil.wasOpenedFromHelpDisplay(url))) { //$NON-NLS-1$
- int i = url.indexOf('?');
- if (i != -1)
- url = url.substring(0, i);
+ url = pathInfo; // without query
+
// ensure the file is only accessed from a local installation
if (BaseHelpSystem.getMode() == BaseHelpSystem.MODE_INFOCENTER
|| !UrlUtil.isLocalRequest(req)) {
@@ -201,7 +208,7 @@ public class EclipseConnector {
is.close();
} catch (Exception e) {
- String msg = "Error processing help request " + getURL(req); //$NON-NLS-1$
+ String msg = "Error processing help request " + url; //$NON-NLS-1$
HelpWebappPlugin.logError(msg, e);
}
}
@@ -347,34 +354,6 @@ public class EclipseConnector {
return con;
}
- /**
- * Extracts the url from a request
- */
- private String getURL(HttpServletRequest req) {
- String query = ""; //$NON-NLS-1$
- boolean firstParam = true;
- for (Enumeration params = req.getParameterNames(); params
- .hasMoreElements();) {
- String param = (String) params.nextElement();
- String[] values = req.getParameterValues(param);
- if (values == null)
- continue;
- for (int i = 0; i < values.length; i++) {
- if (firstParam) {
- query += "?" + param + "=" + values[i]; //$NON-NLS-1$ //$NON-NLS-2$
- firstParam = false;
- } else
- query += "&" + param + "=" + values[i]; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- // the request contains the eclipse url help: or search:
- String url = req.getPathInfo() + query;
- if (url.startsWith("/")) //$NON-NLS-1$
- url = url.substring(1);
- return url;
- }
-
public static void setNotFoundCallout(INotFoundCallout callout) {
notFoundCallout = callout;
}

Back to the top