struts配置问题大家帮忙看下错误在哪里

struts文件



/404.jsp


/photo.jsp



loginAction
public class LoginAction extends ActionSupport implements ModelDriven{
private UserService userService;
private LoginInfo loginInfo=new LoginInfo();
public String execute(){
System.out.println(loginInfo.getUsername());
System.out.println(loginInfo.getPassword());
User user =new User();
user.setUsername(loginInfo.getUsername());
user.setPassword(loginInfo.getPassword());
if(userService.loginCheck(user)){
return SUCCESS;
}
return "fail";
}
public UserService getUserService() {
return userService;
}
@Resource(name="userService")
public void setUserService(UserService userService) {
this.userService = userService;
}
public LoginInfo getLoginInfo() {
return loginInfo;
}
public void setLoginInfo(LoginInfo loginInfo) {
this.loginInfo = loginInfo;
}
public LoginInfo getModel() {
// TODO Auto-generated method stub
return loginInfo;
}

}

JSP


用户名


密码





web.xml

struts2

org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter




struts2
/*

错误提示警告: Could not find action or result
There is no Action mapped for namespace / and action name loginAction. - [unknown location]

Exception starting filter struts2
Unable to load configuration. - [unknown location]

Caused by: Caught exception while loading file struts-default.xml - [unknown location]

Caused by: java.lang.ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration

http://blog.csdn.net/ldl420783321/article/details/7546607

struts文件配置错了,说了找不到action

Exception starting filter struts2
Unable to load configuration. - [unknown location]

Caused by: Caught exception while loading file struts-default.xml - [unknown location]

Caused by: java.lang.ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration

异常显示是action配置问题,检查下struts2.xml配置文件,是否配置了这个action。

struts-default加载失败。。

给出web。xml的配置,还有struts.xml的配置看看

把web.xml和struts.xml的配置文件贴出来

在struts的配置文件中有这个配置,可能你没有配置这个或者配置的其他,在你访问时要加上你配置的namespace。
然后是上面标签里面配置action:

/HelloWorld.jsp