As a rule, you will interact with parameters in your actions using the fields in your actions set by the setters. Assume the following URLs for my example Struts2 action:
URL
http: // localhost / myAction? firstName = SonOfTheEARTh
Action code
public class MyAction extends ActionSupport {
private String firstName;
public String execute() throws Exception {
return SUCCESS;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(final String firstName) {
this.firstName = firstName;
}
}
Jsp
Struts: <s:property value="firstName"/>
JSP EL/JSTL: ${action.firstName}