Figure 1.1. The Java Servlet API exposes the HTTP client/server protocol to the Java platform. Struts 2 is built on top of that.
|
For Web applications, the HTTP has both hurdles to get over. It ' s stateless, and it's text based.
Don ' t reinvent the wheel
Filterdispatcher:early version
Figure 1.4. Struts 2 request processing uses interceptors that fire before and after the action and result.
The Valuestack is a storage area, holds all of the data associated with the processing of a request.
The actioncontext contains all of the data is makes up the context in which an action occurs. This includes the Valuestack but also includes stuff the framework itself would use internally, such as the request, Sessio N, and application maps from the Servlet API.
OGNL is a powerful expression language (and more) that's used to reference and manipulate properties on the Valuestack.
Typically, it is considered bad form to obtain the contents of the actioncontext yourself. The framework provides many elegant ways to interact with that data without actually touching the actioncontext, or the Va Luestack, yourself. Primarily, you'll use OGNL.
Figure 2.6. Anatomy of a url:mapping a URL namespace to a Struts 2 action namespace
Reread "Struts in Action"