Some time ago in the use of Struts2, more is considered by the JSP get action stored in the session or request key.
Such as:
Public String getinfbysal () {
Connection con = oracleconnectionmanager.getconnection ();
Userdao Userdao = new Userdao ();
Arraylist<userbean> userlist = Userdao.getuserinfbysal (Con,this.lowsal, this.hisal);
if (userlist!= null) {
Actioncontext ac =actioncontext.getcontext ();
Ac.put ("UserList", userlist);
Return "Success";
}else{
Return "Failed";
}
}
The put () method using Actioncontext, which is the action context, stores the required delivery information as a key-value pair in the Request object. This shows that Actioncontext is a request level class.
And to get the JSP stored in request from the action, the key needs to be
Gets the Request object
//HttpServletRequest request = (HttpServletRequest) Ac.get from the action context (servletactioncontext.http_requ EST);
String id = request.getparameter ("id");
Gets the Request object
//String id = servletactioncontext.getrequest () getparameter ("id") from the container action context;
Convert Actioncontext to Servletactioncontext
And the session is relatively easy to get
Actioncontext.getcontext (). GetSession (). get ();
Can.