Eleventh book struts2

w3c course

 

struts2 very good MVC framework

Traditional java object for action execute No longer coupled with servlet View technology AOP Extensible Ajax

 

Request response model: IE ----- servlet ---- call model/java bean ---- forward jsp --- generate response

 

The difference between mvc thinking and observer pattern

 

----------------------

action -- the model

interceptors --- Interceptors

valueStatck ------------ Provides a common route link-other component integration 

rest , view

 

  1. Controller dispatches servlet filters and interceptors via struts2
  2. Models are implemented through actions
  3. A view is a combination of result type and result

The life cycle

  • The user issues a resource request to the service
  • The core controller determines the action after viewing the request
  • Configure the interceptor function using the verification file, etc.
  • perform the selected action
  • Configure interceptor post-processing
  • View display results

WEB.XML is a J2EE configuration file

  BS Architecture   

   controller ------------browser -------------------view

dispatcherFilter                                               |

Interceptors                                                    |

     |                                                                 |

 model /action ------------------------------------- jsp

 

 

 

The return string of the no-parameter method must be a POJO

 

interceptor = servlet filter = JDK proxy class

Cross-cutting: Process before calling action, and catch exception after calling action

 

 

result type

 

A value stack is a set of objects

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326020011&siteId=291194637