Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

httpservletrequest setParameter()?

 
Edward Chen
Ranch Hand
Posts: 798
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a html form using post method. the url looks like
localhost/job.do?myquery=4_5
I want to change to
localhost/job.do?myqueryString=4&myqueryString=5

I want to do it this in the server side. I want to do a filter, if server finds the "myquery", then split string, add it back to URL , then forward.

Now, the problem is, we don't have options to control parameter, for example, setParameter().

How to solve it?

Thanks
 
Carl Trusiak
Sheriff
Posts: 3340
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your filter create an HttpServletRequestWrapper

In your wrapper have most methods simply delegate to the wrapped request, add the method addParameter, and override the getParameter type methods as necessary to correctly give values back. Then when you call the doFilter method, pass the wrapper instead of the original request.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic