Struts2的修炼

修炼Struts2快一个星期了,了解了不少,感觉要比Struts1简洁明快许多,很喜欢,目前抵达:

 

http://struts.apache.org/2.2.1/docs/message-resource-files.html

 

到配置文件,即xxx.properties,xxx与Action类同名,注意大小写,及所在包的层次,在哪个层次的properties文件,执行过该层次的Action的view层可以用到(The keys and values defined in that property file will be available to all the view pages that are rendered after executing an Action class.)。

 

2010.12.29

http://struts.apache.org/2.2.1/docs/struts-2-form-tags.html

学了各式各样的form组件,如select,radio,checkbox,checkboxlist等。

一般集合组件包含两个值内容,所有范围值内容和预选值内容,包括标签值等,但其中checkboxlist的hidden域只有一个,貌似传输的信息是是否多选!?

 

2010.12.30

http://struts.apache.org/2.2.1/docs/wildcard-method-selection.html

看到了方法调用通配符这一章

<action name="*Person" class="org.apache.struts.tutorials.wildcardmethod.action.PersonAction" method="{1}">
    <result name="success">view.jsp</result>
    <result name="input">input.jsp</result>
</action>

 *代表任意,零或多个字符,这里也就能代表任意以Person结尾的action都会被映射到PersonAction,后面的method="{1}"就是等于前方*所代表的,原文:

The * is the wildcard character. Any action name values that end in "Person" will be handled by this action mapping. Whatever value is before "Person" will be the value used for the method attribute (the {1} place holder will be replaced with that value).

 

2011.01.04

http://struts.apache.org/2.2.1/docs/struts-2-annotations.html

终于完成了struts2教程的最后一课,这一章旨在通过努力减少struts2的更多依赖,如配置xml等,它可以通过convention来实现,这样就能使项目更简洁。

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值