• 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

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?
roses are red, violets are blue. Some poems rhyme and some are a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic