Author:Peach
Date:2011-5-18
1.过滤器
a> org.apache.struts2.dispatcher.FilterDispatcher
b> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
这两者有何特点,怎么去区分?
2.在不使用struts.xml的时候,可以采用注解的方式来响应页面
比如:@Action(value="/welcome", results={@Result(name="success", location="/results/successPage.jsp")})这个时候的Action没有实现com.opensymphony.xwork2.Action
使用struts.xml后。可以通过配置result来响应页面
3.迭代状态值对应的属性信息
The table show the different properties of the IteratorStatus object.
The table show the different properties of the IteratorStatus object.
Name Return Type Description
index int zero-based index value.
count int index + 1
first boolean returns true if it is the first element
last boolean returns true if it is the last element
even boolean returns true if the count is an even number.
odd boolean returns true if the count is an odd number.
modulus int takes an int value and returns the modulus of count.
4.关于拦截器:
默认的拦截器,那是必须的。如果你需要使用新的拦截器,比如急自己写的做特定用处的,需要和默认的拦截器组成一个拦截器栈,并将这个拦截器栈作为你默认的拦截器,或者在你的action中配置一个拦截器去拦截请求
5.关于验证
页面:在head标签内加入<s:head />,消息的样式就引入进来了
后台:extends ActionSupport, override validate(),使用类库中的addFieldError(),addActionError()来获取消息内容