Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HttpServletRequest - SetParameter

I know that I can use HttpServletRequest.getParameter() to get the URL parameter values.

Is there an equivalent method with which I can set/replace the value?

like image 544
AJM Avatar asked Feb 23 '10 16:02

AJM


1 Answers

No, there is not.

You can only change attributes, not parameters.

The only way to achieve something similar would be to wrap the request (with a class that returns something else for getParameter).

Related curiosity: There is a bug in some servlet containers that would let you do request.getParameterValues(name)[0] = "newValue", but this can only lead to inconsistencies.

like image 77
Thilo Avatar answered Oct 04 '22 17:10

Thilo