• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

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

Ranch Hand
Posts: 281
  • Mark post as helpful
  • send pies
  • 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?
Story like this gets better after being told a few times. Or maybe it's just a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!