File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Regarding Query String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Regarding Query String" Watch "Regarding Query String" New topic

Regarding Query String

santhosh kumar vk
Ranch Hand

Joined: Aug 25, 2009
Posts: 151

How to pass + sign in query sting using jsp and how can we get it in struts action.

Thanking you.
Ankit Garg

Joined: Aug 03, 2008
Posts: 9465

The query string is automatically added to the URL by the browser if you have a <form> tag in your page whose method is set to GET (which is the default) and you submit that form. How you get this in Struts depends upon the version of Struts you are using. Struts automatic converts the request parameters to properties of ActionForm (Struts 1) or Action or Model driven object (Struts 2). If you want access to the complete query string, then in Struts 1 you have direct access to the HttpServletRequest object which has a getQueryString method. In Struts 2 your action can implement the ServletRequestAware interceptor to get access to the HttpServletRequest object...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
I agree. Here's the link:
subject: Regarding Query String
It's not a secret anymore!