struts + spring + hiberante整合问题 SPRING的路径配置有问题吗??你的是什么错误啊?你说我们才能帮我看啊~表面没看出什么毛病! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 action="./login.do" 多了个点还有,spring和hibernate整合的最好以监听器的方式配置在web.xml文档中 对不起,我改一下,说清楚一点. 我的myeclipse6.0整合SSH怎么么都是不成功的啊,用myeclipse5.0就不问题,都是一模一样的整合,怎么就不行呢,别人的就行,我是这样整合的,帮我看看错在哪,它提示的是404错误, HTTP Status 404 - Servlet action is not available The requested resource (Servlet action is not available) is not available. 我的 web.xml 是这样的 <?xml version="1.0" encoding="UTF-8"?><web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/struts-config.xml</param-value> </init-param> <init-param> <param-name>debug</param-name> <param-value>3</param-value> </init-param> <init-param> <param-name>detail</param-name> <param-value>3</param-value> </init-param> <load-on-startup>0</load-on-startup> </servlet> <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list></web-app> jsp页面是这样的 test.jsp <%@ page language="java" pageEncoding="ISO-8859-1"%><html> <head> <title>test.jsp</title> </head> <body> <form action="test.do" method="post"> login:<input type="test" name="login"><br> password:<input type="text" name="password"><br> <input type="submit"> </form> </body> </html> TestAction.java是这样的 public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { TestForm testForm = (TestForm) form;// TODO Auto-generated method stub return mapping.findForward("success"); } struts-config.xml是这样的 <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd"><struts-config> <data-sources /> <form-beans> <form-bean name="testForm" type="com.one.struts.form.TestForm" /> </form-beans> <global-exceptions /> <global-forwards /> <action-mappings> <action attribute="testForm" input="/test.jsp" name="testForm" path="/test" scope="request" parameter="method" type="org.springframework.web.struts.DelegatingActionProxy"> <forward name="success" path="/success.jsp" /> </action> </action-mappings> <message-resources parameter="com.one.struts.ApplicationResources" /> <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn"> <set-property property="contextConfigLocation" value="/WEB-INF/beans.xml" /> </plug-in></struts-config> beans.xml是这样的,省略了一部分数据源的配置 <bean name="/test" class="com.one.struts.action.TestAction"></bean> 应该是这样整合吧,myeclipse5.0一点问题也没有. 出现那样的情况,有可能是包不齐全呀,不要太依靠那个IDE,它在说也只是一个工具,从网上下载新的包都放在classpath目录下面,试试看 我在初次接触三者整合的时候也出现了你类似的问题1、你把“Servlet action is not available ”google一下,会出现解决方法的。2、把log4j.properties加上看看,报什么异常,是不是sessionFactory出的问题。3、很有可能是hibernate jar包版本问题 加个这个试试<controller processorClass="DELEGATINGREQUESTPROCESSOR">在哪个包下忘了. 用log4j看看日志,估计是包的问题。 mayaa框架 中 不可以 <m:if> 嵌套 <m:for> 吗? js控制点击事件 IE6能用,IE8不能用。 spring的application.xml文件哪里找 html标签 实际开发中的xml [请教]构造函数可以使用Socket形参数吗? JBuilder7 + Weblogic7 + SQL2000 开发EJB? 用JavaMail接收邮件时如何判断邮件是否有附件? hibernate的默认值设置问题 关于 Hadoop HDFS中的fsimage 我的总是报连接池溢出的问题,希望各位大侠帮忙解决一下 JSF里的bean代码怎么样实现页面的转换?
我的myeclipse6.0整合SSH怎么么都是不成功的啊,用myeclipse5.0就不问题,都是一模一样的整合,怎么就不行呢,别人的就行,我是这样整合的,帮我看看错在哪,它提示的是404错误, HTTP Status 404 - Servlet action is not available
The requested resource (Servlet action is not available) is not available. 我的 web.xml 是这样的 <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
jsp页面是这样的 test.jsp <%@ page language="java" pageEncoding="ISO-8859-1"%>
<html>
<head>
<title>test.jsp</title>
</head>
<body>
<form action="test.do" method="post">
login:<input type="test" name="login"><br>
password:<input type="text" name="password"><br>
<input type="submit">
</form>
</body>
</html> TestAction.java是这样的
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
TestForm testForm = (TestForm) form;// TODO Auto-generated method stub
return mapping.findForward("success");
} struts-config.xml是这样的 <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">
<struts-config>
<data-sources />
<form-beans>
<form-bean name="testForm" type="com.one.struts.form.TestForm" /> </form-beans> <global-exceptions />
<global-forwards />
<action-mappings>
<action attribute="testForm"
input="/test.jsp"
name="testForm"
path="/test"
scope="request"
parameter="method"
type="org.springframework.web.struts.DelegatingActionProxy">
<forward name="success" path="/success.jsp" />
</action> </action-mappings> <message-resources parameter="com.one.struts.ApplicationResources" /> <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation" value="/WEB-INF/beans.xml" />
</plug-in>
</struts-config>
beans.xml是这样的,省略了一部分数据源的配置
<bean name="/test" class="com.one.struts.action.TestAction"></bean>
应该是这样整合吧,myeclipse5.0一点问题也没有.
1、你把“Servlet action is not available ”google一下,会出现解决方法的。
2、把log4j.properties加上看看,报什么异常,是不是sessionFactory出的问题。
3、很有可能是hibernate jar包版本问题
<controller processorClass="DELEGATINGREQUESTPROCESSOR">
在哪个包下忘了.