This week's giveaway is in the Java/Jakarta EE forum. We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line! See Which doesn't work, how i would properly write this in JSP (avoiding a scriptlet if possible, if not, a scriptlet is ok too).
There, you will see the public methods getParameter() but no setParameter(), instead, there exist setAtribute() and getAtribute, that is what you are really doing in the code you posted inside the first message.
Tudor Andrei Raneti wrote:I thought it's obvious from the code
Nothing is ever "obvious from the code". In the future please be sure to clearly explain what you are trying to accomplish.
The question is only obvious to the answerer. Thus the name of the topic too. I find that people who don't care to answer a question also find the question meaningless, hence not obvious. And an answer has been given, thanks for sharing your opinion though.
EDIT1: I wonder if reflection can do anything to the request object, AFAIK it can, not gonna try it though if i can avoid it.