原创 2007年10月15日 16:45:00

1.struts2.x povides features to reduce xml configuration via intelligent defaults,utilizes

annotations and provides conventions over configuration.Actions are now POJOs which increases

testability and reduces coupling in the framework, and HTML form field data is converted to proper

types for the action to use.
2.Struts2 is a pull-MVC (or MVC2)framework; this is slightly different from a traditional MVC
framework in that the action takes the role of the model rather than the controller, although there

is some overlap.
3.The configuration file  provides a mechanism to change the default behavior of

the framework.
4.A familiar technique for most web developers is to place the object that needs to be accessed in

the HttpServletRequest or the HttpSession. This can be achieved by implementing the “aware”

interface (letting the dependency injection to do its work) and then setting the object to be

accessed under the required name.
5.The value stack is exactly what it says it is – a stack of objects. OGNL stands for Object Graph

Navigational Language, and provides the unified way to access objects within the value stack.
<action name=”*/*” method=”{2}”
<result type=”redirect”>/{1}/view.action</result>
<result name=”view”>/{1}/view.jsp</result>
<result name=”input”>/{1}/edit.jsp</result>
<result name=”home”>/{1}/home.jsp</result>
The action will need to extend the ActionSupport class (providing validation and error message

handling implementations) and implement the ModelDriven and Preparable interfaces. The interceptor

stack along with the two interfaces is the key to making the implementation easy, so let’s
take a look at those in more detail.
 <action name="List" class="tutorial.action.BookAction" method="list">