struts.xml中如下
<constant name="struts.enable.DynamicMethodInvocation" value="true" />
<constant name="struts.devMode" value="true" />
<constant name="struts.convention.action.disableScanning" value="false" />
<constant name="struts.convention.classes.reload" value="true" />
<constant name="struts.convention.result.path" value="/WEB-INF/content/" />
<constant name="struts.convention.default.parent.package" value="default"/>
<constant name="struts.convention.package.locators" value="action"/>
action包的位置
fran.hu.webStruts2_3.action
action 如下
1 package fran.hu.webStruts2_3.action; 2 3 import com.opensymphony.xwork2.ActionSupport; 4 5 import fran.hu.webStruts2_3.entity.LoginUser; 6 7 public class LoginAction extends ActionSupport { 8 9 /** 10 * 11 */ 12 private static final long serialVersionUID = -8434771134253346865L; 13 14 private LoginUser user; 15 public String Securty(){ 16 System.out.println("execSecurty"); 17 return SUCCESS; 18 } 19 public LoginUser getUser() { 20 return user; 21 } 22 public void setUser(LoginUser user) { 23 this.user = user; 24 } 25 }
目录如下
项目没有报错,不使用convention之前正常使用
如何才能访问到action
http://localhost:8080/webStruts2_3/login!securty.action
404