This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
1)parameters - Map of request parameters for this request
2)request - Map of request-scoped attributes
3)session - Map of session-scoped attributes
4)application - Map of application-scoped attributes
5)attr - Returns first occurrence of attribute occurring in page, request,session, or application scope, in that order
6)ValueStack - Contains all the application-domain–specific data for the request
I am having a variable name with getter & setter in my Action class ,is that it will store in the values in both parameters & value stack as mentioned above?
sarada chellub wrote:I am having a variable name with getter & setter in my Action class ,is that it will store in the values in both parameters & value stack as mentioned above?
It depends whether the variable (lets say username) came in as a request parameter or not. If the request did contain a parameter named username, then username will be in the parameters as well as the value stack (as the whole action object goes into the value stack)...
The value will go into the value stack as its in the action and the action goes into the value stack. And as it was received as a request parameter, it will also be in the parameters map for any future actions or JSPs. If its removed from the parameters, any further action or JSP which might process the request might think that the request didn't have that parameter, this might confuse it into thinking that the parameter wasn't sent so the request should be aborted or an error message sent to the user...