首页 > 其他 > 详细

重读《Struts In Action》

时间:2015-04-13 09:17:59      阅读:290      评论:0      收藏:0      [点我收藏+]

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, HTTP has two 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 that holds all of the data associated with the processing of a request.

The ActionContext contains all of the data that makes up the context in which an action occurs. This includes the ValueStack but also includes stuff the framework itself will use internally, such as the request, session, and application maps from the Servlet API.

 

OGNL is a powerful expression language (and more) that is 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 ValueStack, yourself. Primarily, you’ll use OGNL to do this.

 

Figure 2.6. Anatomy of a URL: mapping a URL namespace to a Struts 2 action namespace

技术分享

 

重读《Struts In Action》

原文:http://www.cnblogs.com/IcanFixIt/p/4421258.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!