这是我的web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" 
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">
   <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>
   <load-on-startup>0</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="ISO-8859-1" ?><!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
          "http://struts.apache.org/dtds/struts-config_1_3.dtd"><struts-config>
    <form-beans>
     <form-bean name="loginform" type="cn.demo1.LoginForm"></form-bean>    
    </form-beans>    <action-mappings>
<action path="/Login" type="cn.demo1.LoginAction" name="loginform">
<forward name="loginSuccess" path="/LoginSeccess.jsp"></forward>
<forward name="loginFailure" path="/LoginFailure.jsp"></forward>
</action>
    </action-mappings></struts-config>这是我的Login.jsp
<form action="<%=request.getContextPath()%>/Login.do" method="post">当我运行Login.jsp,点击【提交】出现下列错误:type Status reportmessage Servlet action is not availabledescription The requested resource (Servlet action is not available) is not available.
各位达能帮看看,怎么回事呀?

解决方案 »

  1.   

    路径问题。你点提交的时候 地址栏的url对么?
      

  2.   

    是不是应该在web.xml中配actionDispatcher呢
      

  3.   

    sorry,不是actionDispatcher,是filterDispatcher
      

  4.   

       类型状态报告,,
       你所要求的资料无法使用 Servlet action is not available  
      

  5.   

    action="<%=request.getContextPath()%>/Login.do"这你改成action="Login.do"试试。
      

  6.   

    你打印出来你的路径看看,如果是路径问题,简单的改法是:action="/login.do",复杂的是:action="request.getPageContext.getContextPath",还有你看看你的struts-config.xml文件中的encoding是不是有问题!
      

  7.   

    应该是路径不对,直接写action名就可以了,前面不用加东西
      

  8.   

    路径错了 很明显  没有basePath的情况下 /是到根目录啊 就是127.0.0.1::8080/这个路径下 不会包含你的项目名称了 所以就会报错了 去掉你的”/“,就可以 了