要在事例struts1.2+spring2.0+hibernate3.0出现如下问题: HTTP Status 404 - Servlet action is not available -------------------------------------------------------------------------------- type Status report message Servlet action is not available description The requested resource (Servlet action is not available) is not available. 这个就是运行的时候出现的错误呀..后台没有错误提示! PS:若把有关Hibernate的配置去掉的话..运行就可以了
Action类里的代码,业务逻辑都被我注释掉了... LoginForm loginForm = (LoginForm) form; String username=loginForm.getUsername(); String password=loginForm.getPassword(); return mapping.findForward("success"); /* //调用userDao方法 if(userDAO.isValidUser(username, password)){ return mapping.findForward("success"); }else{ return mapping.findForward("fail"); } */现在问题是有配置关于hibernate的东西就会出来HTTP Status 404 - Servlet action is not available 若只有struts与spring就不会有问题了!!!!
SSH整合先运行一下整合的包是否齐备,再去查业务逻辑是否有错。
加入log4j 查看详细日志 一定会找到报错信息的错误的可能: 1.没有配置好 2.类包版本冲突具体还得看你的日志。HTTP Status 404 - Servlet action is not available -------------------------------------------------------------------------------- type Status report message Servlet action is not available description The requested resource (Servlet action is not available) is not available. 这样的报错 说明你的整个web应用没有启动成功 报错信息远远不止这些;log4j可以提供帮助的
http://www.itfuture.org/xiangm.jsp
bean /login的依赖注入也没有
报错的提示也没有 没头没脑的 怎么看。
HTTP Status 404 - Servlet action is not available
--------------------------------------------------------------------------------
type Status report
message Servlet action is not available
description The requested resource (Servlet action is not available) is not available.
这个就是运行的时候出现的错误呀..后台没有错误提示!
PS:若把有关Hibernate的配置去掉的话..运行就可以了
<bean id="userDao" class="edu.mju.service.UserDao">
<property name="sessionFactory">
<ref local="sessionFactory"/>
</property>
</bean> 这个不就是业务bean吗?!!
设计就有问题:DAO层bean和业务Bean怎么都没分离<!-- Action的配置,接管struts对Action的管理 -->
<bean name="/login" class="edu.mju.ui.action.LoginAction">
</bean>
/login中没注入业务Bean,对于你的配置来说,就是/longin中没注入userDao改为:
<bean name="/login" class="edu.mju.ui.action.LoginAction">
<property name="userDao" ref="userDao" />
</bean>
LoginForm loginForm = (LoginForm) form;
String username=loginForm.getUsername();
String password=loginForm.getPassword();
return mapping.findForward("success");
/*
//调用userDao方法
if(userDAO.isValidUser(username, password)){
return mapping.findForward("success");
}else{
return mapping.findForward("fail");
}
*/现在问题是有配置关于hibernate的东西就会出来HTTP Status 404 - Servlet action is not available
若只有struts与spring就不会有问题了!!!!
1.没有配置好
2.类包版本冲突具体还得看你的日志。HTTP Status 404 - Servlet action is not available
--------------------------------------------------------------------------------
type Status report
message Servlet action is not available
description The requested resource (Servlet action is not available) is not available.
这样的报错 说明你的整个web应用没有启动成功
报错信息远远不止这些;log4j可以提供帮助的