Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 273184 - Session Timeout when accessing trailing slash URL
Summary: Session Timeout when accessing trailing slash URL
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.3 M2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 227733 277304 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-04-22 02:09 EDT by Alexander Eliseyev CLA
Modified: 2009-09-23 05:28 EDT (History)
3 users (show)

See Also:


Attachments
Proposed fix (3.00 KB, patch)
2009-09-11 07:48 EDT, Vasko Tchoumatchenko CLA
ruediger.herrmann: iplog+
Details | Diff
Alternative solution (2.51 KB, patch)
2009-09-23 05:27 EDT, Rüdiger Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Eliseyev CLA 2009-04-22 02:09:34 EDT
Build ID: N/A

Steps To Reproduce:
1. Configure RAP Application launch with the 'myproject' servlet name
2. Run it and try to access it in a browser with a trailing slash URL: '/myproject/'

The session timeout message will be shown, providing a link to the same '/myproject/' page.

More information:
I've described the behaviour in more details here: http://www.eclipse.org/newsportal/article.php?id=6132&group=eclipse.technology.rap#6132
Comment 1 Ralf Sternberg CLA 2009-05-21 05:54:01 EDT
*** Bug 277304 has been marked as a duplicate of this bug. ***
Comment 2 Rüdiger Herrmann CLA 2009-09-10 08:17:39 EDT
This seems to be related to bug 227733
Comment 3 Vasko Tchoumatchenko CLA 2009-09-11 07:48:32 EDT
Created attachment 146938 [details]
Proposed fix

Most resource URLs in RAP are relative, e.g.:

    rwt-resources/resource/widget/rap/display/bg.gif
    rwt-resources/themes/images/148ab7bc
      
If the initial request to RAP application is:

http://example.com/rap

than the browser will construct the consecutive requests for resources as follows:

http://example.com/rwt-resources/resource/widget/rap/display/bg.gif
http://example.com/rwt-resources/themes/images/148ab7bc

These requests will be correctly resolved to the corresponding resource (or servlet) registrations.

Now, let's suppose that the initial request has a slash (or an entire path) appended after the servlet name:

http://example.com/rap/

the resources requests will have the name of the servlet included in the path:

http://example.com/rap/rwt-resources/resource/widget/rap/display/bg.gif
http://example.com/rap/rwt-resources/themes/images/148ab7bc

These requests will not be resolved to the appropriate resources. They will all end up in the RAP servlet (the RWTDelegate) and the response will consist of the RAP initial HTML page. This explains why the images are not shows as reported in bug 227733. The session timeout is another demonstration of the same issue. It affects application which have the UICallBack  mechanism activated.

The proposed patch redirects requests with slash (or slash and additional path segments) after the servlet name to the correct RAP servlet URL. The original request parameters are preserved in the query string of the redirection URL. The stripped path is also added to the redirection URL as a parameter with name "pathInfo". Therefore the request

http://example.com/rap/

will be redirected to 

http://example.com/rap?pathInfo=/

or a more generic case: 

http://example.com/myContext/myServlet/foo/bar?startup=myEntry

will be redirected to 

http://example.com/myContext/myServlet?startup=myEntry&pathInfo=/foo/bar
Comment 4 Rüdiger Herrmann CLA 2009-09-18 06:35:09 EDT
*** Bug 227733 has been marked as a duplicate of this bug. ***
Comment 5 Rüdiger Herrmann CLA 2009-09-23 05:27:03 EDT
Created attachment 147872 [details]
Alternative solution

* Requests with a trailing slash after the servlet name (e.g. http://example.com/webapp/servlet/) are redirected to the same URL without the trailing slash (http://example.com/webapp/servlet)
* Requests with additional paths (e.g.http://example.com/webapp/servlet/foo) are answered with 404 -not found
Comment 6 Rüdiger Herrmann CLA 2009-09-23 05:28:21 EDT
Committred second patch to CVS HEAD