summaryrefslogtreecommitdiffstats
path: root/src/com/itmill/toolkit/terminal/gwt
diff options
context:
space:
mode:
authorMarc Englund <marc.englund@itmill.com>2008-04-15 12:12:15 +0000
committerMarc Englund <marc.englund@itmill.com>2008-04-15 12:12:15 +0000
commit177ffe19adb272f841d543e6d1a178d59d363226 (patch)
tree272e1feb65f73767152a51833643b287d399fb99 /src/com/itmill/toolkit/terminal/gwt
parentc0de886284de03c6b519989dc8bd76ec26e87f00 (diff)
downloadvaadin-framework-177ffe19adb272f841d543e6d1a178d59d363226.tar.gz
vaadin-framework-177ffe19adb272f841d543e6d1a178d59d363226.zip
Portlet integration refactoring, ApplicationServlet changes.
svn changeset:4179/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/terminal/gwt')
-rw-r--r--src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java b/src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java
index 63ec172b8c..88103d90bf 100644
--- a/src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java
+++ b/src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java
@@ -651,12 +651,24 @@ public class ApplicationServlet extends HttpServlet {
String[] urlParts;
try {
urlParts = getApplicationUrl(request).toString().split("\\/");
+ // TODO remove:
+ System.err.println(getApplicationUrl(request).toString()
+ + " parts: " + urlParts.length);
+ System.err.println(request.getContextPath() + "(servlet ctx)");
appUrl = "";
widgetsetUrl = "";
// if context is specified add it to widgetsetUrl
+ String ctxPath = request.getContextPath();
+ if (ctxPath.length() == 0
+ && request
+ .getAttribute("javax.servlet.include.context_path") != null) {
+ // include request (e.g portlet), get contex path from
+ // attribute
+ ctxPath = (String) request
+ .getAttribute("javax.servlet.include.context_path");
+ }
if (urlParts.length > 3
- && urlParts[3].equals(request.getContextPath()
- .replaceAll("\\/", ""))) {
+ && urlParts[3].equals(ctxPath.replaceAll("\\/", ""))) {
widgetsetUrl += "/" + urlParts[3];
}
for (int i = 3; i < urlParts.length; i++) {
@@ -1066,8 +1078,18 @@ public class ApplicationServlet extends HttpServlet {
.getServerPort() == 80) ? "" : ":"
+ request.getServerPort())
+ request.getRequestURI());
- String servletPath = request.getContextPath()
- + request.getServletPath();
+ String servletPath = "";
+ if (request.getAttribute("javax.servlet.include.servlet_path") != null) {
+ // this is an include request
+ servletPath = request.getAttribute(
+ "javax.servlet.include.context_path").toString()
+ + request
+ .getAttribute("javax.servlet.include.servlet_path");
+
+ } else {
+ servletPath = request.getContextPath()
+ + request.getServletPath();
+ }
if (servletPath.length() == 0
|| servletPath.charAt(servletPath.length() - 1) != '/') {
servletPath = servletPath + "/";