type Status reportmessage /WebModule/loginAction.dodescription The requested resource (/WebModule/loginAction.do) is not available.
不知道是哪配置不对,求教。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>
<form-beans>
<form-bean name="userActionForm" type="bookstore.UserActionForm" />
</form-beans>
<action-mappings>
<action name="userActionForm"
path="/loginAction"
type="bookstore.loginAction">
<forward name="success" path="/welcome.jsp" />
<forward name="fail" path="/fail.jsp" />
<forward name="error" path="/error.jsp" />
</action>
</action-mappings>
<message-resources parameter="ApplicationResources" />
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" />
</plug-in>
<plug-in className="org.apache.struts.tiles.TilesPlugin">
<set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
</plug-in>
</struts-config> web.xml<?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" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
<display-name>WebModule</display-name>
<jsp-config>
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-nested.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
</taglib>
</jsp-config>
<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>2</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>
不知道是哪配置不对,求教。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>
<form-beans>
<form-bean name="userActionForm" type="bookstore.UserActionForm" />
</form-beans>
<action-mappings>
<action name="userActionForm"
path="/loginAction"
type="bookstore.loginAction">
<forward name="success" path="/welcome.jsp" />
<forward name="fail" path="/fail.jsp" />
<forward name="error" path="/error.jsp" />
</action>
</action-mappings>
<message-resources parameter="ApplicationResources" />
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" />
</plug-in>
<plug-in className="org.apache.struts.tiles.TilesPlugin">
<set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
</plug-in>
</struts-config> web.xml<?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" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
<display-name>WebModule</display-name>
<jsp-config>
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-nested.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
</taglib>
</jsp-config>
<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>2</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>
解决方案 »
- jxl Workbook.getWorkbook(is)数组越界
- 网上商城注意事项?
- 关于分页的问题
- 求救贴:碰到过的帮帮忙了javabean出现unable to compile class for jsp (在线等)
- 按照自然历得出一年中的第几周是哪个区间段?
- 应用打包
- org.apache.commons.dbcp.DelegatingStatement is closed.是怎么回事?
- 请问如何在web网页上嵌入word文档,并可以在线编辑,并可以存入服务器
- 求命………高手相救!!!!在线等待
- 请问大家,JBuilder好学吗
- 多CPU多线程问题
- HTTP Status 404 - /learnServlet/HelloServlet
你这样别人很难发现问题!
配置文件有错
<action name="userActionForm"
path="/loginAction"
你配置信息写的是这个
/WebModule/loginAction.do
你请求的确是这个PATH,与配置信息不一致。
<form name="form1" method="post" action="/loginAction.do">struts-config.xml中
<action name="userActionForm"
path="/loginAction"
type="com.yourcompany.struts.bookstore.loginAction">web.xml中
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping> 出现相同问题:
type Status reportmessage /loginAction.dodescription The requested resource (/loginAction.do) is not available.
path="/loginAction"
type="com.yourcompany.struts.bookstore.loginAction"> 应该是你这里的path有问题/WebModule/loginAction试试
改成action="loginAction.do",不加/
加了/WebModule说找不到WebModule/loginAction.do
应该是这样的吧:type="com.yourcompany.bookstore.struts.loginAction">
The requested resource (Servlet action is not available) is not available.
<form action="<%=path%>/ loginAction.do " name="form1" method="post" >如果还不行,可能就是你的Action类的问题,看看有没有默认的方法共调用!