`
myoldman
  • 浏览: 83355 次
  • 性别: Icon_minigender_1
  • 来自: 福建福州
最近访客 更多访客>>
社区版块
存档分类
最新评论

Struts2 Core Developers Guide-tutorial

阅读更多
1.Dependency of struts2
struts2最小依赖包
struts2-core.jar-->核心包。
xwork.jar-->xwork2依赖库
ognl.jar-->Object Graph Navigation Language(OGNL),el语言库。
freemarker.jar-->大名鼎鼎的模板生成器,文档解释说所有UI tag的模块都是基于该框架处理的。这点需要进一步深入解释。
commons-logging.jar-->log记录框架。
2.configuration of action in struts.xml
web.xml-->定义struts映射的filter。这个是所有基于servlet的web框架的切入点。
struts.xml-->定义了struts运行所需要的action,results,拦截器,拦截器堆栈等。
3.How to use tags for render the dynamic data of response.(s:url,s:a,s:textfield,s:password and so on)
这个是所有j2eeweb框架都具有的特性,标签库,主要目的也是为了封装html的语法,简化编写,提高效率。
4.Wildcard mappings by using asterisk(*) and "{1}" grammer.
通配符映射,可以加前缀合或者后缀,该特性可用于灵活的定义action之间的关系,以实现类似与ror似的0配置管理。
5.Coding action and the processing of struts2 framework for http request.
合webwork时代的写法一致。大部分情况下继承于ActionSupport类。并且Action中不暴露任何request,respones相关的信息,完全依赖于struts2利用valuestack把表单的值映射到Action的model中。
6.Select result for after the process of the execute function in action.
这个不用解释了,就是根据action方法中返回的字符串和struts.xml中配置的result决定action处理完某个request后的跳转。success的结果可以不需要在result标记中定义name属性其他的结果都需要定义result的name属性。
7.Including missing page for pages the not yet implemented.
把name="*"的action放到action的最后,并且跳转到于Action名称相对应的页面,并且该页面上如果是一个未完成的页面需要直接include一个missing页面以提醒开发这该页面还未实现。
8.How to validate the input data in the server side.
struts2利用xwork的validation库进行表单验证某个action对应的验证xml文件的格式为Actionname-validation.xml或者Actionname-alias-validation.xml其中alias为某个action类在struts配置文件中对应的别名。
9.Localized the message field.
本地化i10n和国际化i18n是目前web应用的都需要考虑的地方,其主要目的是提前考虑到应用系统如何适应多国语言的处理,把页面中所有静态的语言表示都使用使用message.properties文件映射起来。这样对于不同的语言只要相应的添加该语言的properties文件即可,从而不用为某个语言重新开发,测试应用。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics