1. struts.propeties 不能改变大小写 - - !失败呀!找了半天问题。同时这个貌似不能改变位置,我在web.xml中加载它所在的位置不摆我。所以老老实实的放在外面
这里面的可以放一些常量配置,这里能配置的,在struts.xml中通过常量都能配,举例说明:
struts.action.extension=do,action 这个是propeties中的配置在struts.xml中对应<constant name="struts.action.extension" value="do,action" />这个表示请求结尾可以是.do和.action,但是我试验得出可以直接写。如list.do可以直接list。
2.命名空间,最好package的name最好都写上,层次清楚,在请求地址的时候也都加上比如:products/list.do。这个可以直接写list.do但是不知道它属于哪个包里面的,系统会默认去所有包里面找,加上package可以有相同的请求只是包不一样。users/list.do 和products/list.do
3.<include file="struts_xml/interceptors-struts.xml"></include>可以在不同位置,呵呵
4. struts.xml中如果
<action name="login" class="com.ssh.books.web.actions.LoginAction">
<result name="success">/book/success.jsp</result>
<result name="error">/book/error.jsp</result>
</action>
没指方法名称,则默认执行LoginAction中的execute()的方法。
5.ActionContext 和ServletActionContext基本相同,都可以实现Context,request,reponse等,能使用前者使用前者。