S2 provides a clean way to fetch the request parameters in you action class all you need to follow these simple rules.
- Create a property with same name as request parameter name.
- create getter and setters for this property or make property public (for S2.1+)
S2 will check the request parameter and will look for matching property in your action class and will inject the value in respected property.
in your case all you need to do
public class MyAction extends ActionSupport{
private String idUser;
getter and setters
}
So in this case S2 will find the idUser
property in your action class and its build in interceptor will inject the value in the idUser
property
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…