Using the Servlet API step in Struts2
Objects such as request are declared in the action class
Map<string, object> request;
Get Actioncontext instances
Actioncontext Ac=actioncontext.getcontext ();
Get objects such as request
Request= (map<string, object>) ac.get ("request");
Saving data in objects such as request
Request.put ("loginaccess", "Login Location: Beijing");
Request.get ("loginaccess");
Get the way to save data in the page
<s:property value= "#request. Loginaccess"/> Access servlet API
Other ways to access the servlet API
Previous ways to get Servlet API objects
Get Request:ac.get Yourself ("request")
Structs2=structs1 's popularity and market +webwork techniques convert a string to a OGRL expression%{}
Get Session:ac.getSession Yourself ()
Let "someone else" provide you with the Servlet API object
Get the Servlet API object by implementing the appropriate interface
Obtaining the request requires implementing the Requestaware interface
Getting the session requires implementing the Sessionaware interface
Get application need to implement Applicationaware interface
Using the Servlet API step in Struts2