[ 
https://issues.apache.org/jira/browse/TUSCANY-1974?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12582937#action_12582937
 ] 

ant elder commented on TUSCANY-1974:
------------------------------------

The following two changes fix this problem for me. The problem is caused by a 
bug in WebAppRequestDispatcher including the webapp context path in its 
servletPath, this change strips out the context path so the 
WebAppRequestDispatcher servlet path really is just the servlet path. 

I'm just adding the fix to the jira as this late in the 1.2 release I'm a bit 
worried there may be samples that have come to rely on the old behaviour and i 
don't have time to test them all sorry.

Index: 
modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java
===================================================================
--- 
modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java
 (revision 639228)
+++ 
modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java
 (working copy)
@@ -185,7 +185,7 @@
             if (servletPath.endsWith("*")) {
                 servletPath = servletPath.substring(0, servletPath.length() - 
1);
                 if (suri.startsWith(servletPath)) {
-                    return new WebAppRequestDispatcher(entry.getKey(), 
entry.getValue());
+                    return new 
WebAppRequestDispatcher(entry.getKey().substring(contextPath.length()), 
entry.getValue());
                 } else {
                     if ((suri + "/").startsWith(servletPath)) {
                         return new WebAppRequestDispatcher(entry.getKey(), 
entry.getValue());

C:\Tuscany\SVN\LATEST>svn diff 
modules\binding-dwr\src\main\java\org\apache\tuscany\sca\binding\dwr\DWRServlet.java
Index: 
modules/binding-dwr/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRServlet.java
===================================================================
--- 
modules/binding-dwr/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRServlet.java
        (revision 639228)
+++ 
modules/binding-dwr/src/main/java/org/apache/tuscany/sca/binding/dwr/DWRServlet.java
        (working copy)
@@ -146,7 +146,7 @@
         // Use the DWR remoter to generate the JavaScipt function for each SCA 
service
         Remoter remoter = 
(Remoter)getContainer().getBean(Remoter.class.getName());

-        String path = request.getServletPath();
+        String path = request.getContextPath() + request.getServletPath();

         for (String serviceName : services.keySet()) {
             String serviceScript = 
remoter.generateInterfaceScript(serviceName, path);

> Chat webapp sample misses chat messages
> ---------------------------------------
>
>                 Key: TUSCANY-1974
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1974
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Samples
>    Affects Versions: Java-SCA-1.1
>         Environment: Tuscany 1.1 RC1
> RHEL5
> IBM JDK 1.5
> Tested Firefox 2.0.0.11 and 3.0 beta2
>            Reporter: Jean-Sebastien Delfino
>            Assignee: ant elder
>             Fix For: Java-SCA-1.2
>
>
> To reproduce the issue:
> Deploy the Chat webapp to Tomcat and open it in Firefox
> enter nickname: test1, text: 1
> nothing is logged, the message seems to be lost
> enter text: 2, then 2 is logged
> Another weird issue:
> open another window
> enter nickname: test2, text: a
> again 'a' is lost
> enter text b, this time b is logged
> Go back to the first window
> enter several text messages
> they are logged in the first window but none of them is logged in the second 
> window
> The chat application does not seem to really work.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to