• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

getRequestURI() returns query parameters for path="/submit.do?my=Update" in WebSphere 5.1

 
Ranch Hand
Posts: 281
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In WebSphere 5.1 test server for Struts 1.1 application, I noticed that request.getRequestURI() also returns the query string, if the forward happens to have query parameters like below:

<forward name="success" path="/submit.do?my=Update"/>

request.getRequestURI() call inside an Action class returns /MyProjWeb/submit.do?my=Update

According to specification, getRequestURI() should not return the query string my=Update. According to specification, getRequestURI() should only return /MyProjWeb/submit.do.

Is it correct behavior for Struts to return query string also path is appended with query string?

Please note that the same code returns /MyProjWeb/submit.do only, when I run it in WebSphere 6.1.

Let me point out that request.getRequestURI() correctly returns only the URI (excludes query string) for both WebSphere 5.1 and 6.1 for a non-Struts application. As such, both WebSphere 5.1 and 6.1 are correctly meeting Servlet specification - no surprise there.

Query string is also returned only when I use forward in Struts and append query string in the path of forward in struts-config.xml in WebSphere 5.1 (behaves correctly in WebSphere 6.1).

My question:
1. Is this the expected behavior in Struts 1.1 to also append the query string, when getRequestURI is called?
2. Or, is it WebSphere 5.1 specific bug that got rectified in WebSphere 6.1?
 
reply
    Bookmark Topic Watch Topic
  • New Topic