我查了一天了,看了很多相关的解决方案,还是没有解决,我想请csdn的牛人帮我看看.我把原文件贴出来,大家帮我看看是怎么回事.谢谢
启动项目不报错,在jsp页面提交时报这个错误
HTTP Status 404 - Servlet action is not available--------------------------------------------------------------------------------type Status reportmessage Servlet action is not availabledescription The requested resource (Servlet action is not available) is not available.
applicationContext.xml配置文件
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"><beans>
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
<value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
</property>
<property name="url">
<value>jdbc:microsoft:sqlserver://localhost:1433</value>
</property>
<property name="username">
<value>sa</value>
</property>
<property name="password">
<value></value>
</property>
</bean> <bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.SQLServerDialect
</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>com/shop/front/hbm/xml/UserInfo.hbm.xml</value>
</list>
</property>
</bean>
<bean id="userInfoDAO" class="com.shop.front.dao.UserInfoDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="userinfo" class="com.shop.front.business.UserInfoImpl">
<property name="userInfoDAO">
<ref bean="userInfoDAO" />
</property>
</bean>
<bean name="/userInfo"
class="com.shop.front.struts.action.UserInfoAction">
<property name="userinfo">
<ref bean="userinfo"/>
</property>
</bean>
</beans>
启动项目不报错,在jsp页面提交时报这个错误
HTTP Status 404 - Servlet action is not available--------------------------------------------------------------------------------type Status reportmessage Servlet action is not availabledescription The requested resource (Servlet action is not available) is not available.
applicationContext.xml配置文件
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"><beans>
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
<value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
</property>
<property name="url">
<value>jdbc:microsoft:sqlserver://localhost:1433</value>
</property>
<property name="username">
<value>sa</value>
</property>
<property name="password">
<value></value>
</property>
</bean> <bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.SQLServerDialect
</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>com/shop/front/hbm/xml/UserInfo.hbm.xml</value>
</list>
</property>
</bean>
<bean id="userInfoDAO" class="com.shop.front.dao.UserInfoDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="userinfo" class="com.shop.front.business.UserInfoImpl">
<property name="userInfoDAO">
<ref bean="userInfoDAO" />
</property>
</bean>
<bean name="/userInfo"
class="com.shop.front.struts.action.UserInfoAction">
<property name="userinfo">
<ref bean="userinfo"/>
</property>
</bean>
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.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>
</web-app>
<?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="userInfo" type="com.shop.front.vo.UserInfo" />
</form-beans>
<global-exceptions />
<global-forwards />
<action-mappings>
<action path="/userInfo"
type="org.springframework.web.struts.DelegatingActionProxy"
attribute="userInfo" name="userInf" scope="request" input="/login.jsp">
<forward name="success" path="/success.jsp" />
</action>
</action-mappings> <message-resources parameter="com.shop.struts.ApplicationResources" /> <plug-in
className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation"
value="/WEB-INF/applicationContext.xml" />
</plug-in>
</struts-config>
<form action="popedom.do" method="post">
<input type="submit">
</form>action的操作部分代码
System.out.println("-------------");
return mapping.findForward("success");
在你的struts-config.xml文件中并没有对 popedom进行配置啊
jsp是
<form name="form1" method="post" action="userInfo.do">
..........
<input type="submit" value="登陆"/>
</form>