Web tier: servlets, JSP, Web frameworks: How to replace/add parameters of request object
Can anybody help me on changing or adding new parameters to request(HttpServletRequest) object?
- Posted by: Burak AKSOY
- Posted on: September 15 2002 08:03 EDT
I haven't found a method like
setParameter(String argParamName,String argParamValue)
That is an unusual requirement.
I had to achieve the same thing once while creating a base class to represent a JUnit test case to test a servlet. We were forced to write our own implementation of the Servlet interface and add the setParameter method as an additional method.
What's your scenario like?
We have some web beans which adjust its output according to a parameter "ActionType" , but before this web bean produces its output some times it is necessary to change "ActionType" to another value than submitted by the user. This is the case ...
You can do it with Filters and RequestWrapper.
If you would download netBeans you'd be able to see examples (just select advanced filter template)