我用myeclipse做的WEB项目后,可转而在别的机器上单独用Tomcat6 发布web项目 可以进入项目登录主页面 但是再进入登录按钮时却跳转不到指定页面,却显示如下内容
The requested resource (Servlet action is not available) is not available.这是我的struts配置文件<?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="accountForm" type="com.Account.struts.form.AccountForm" />  </form-beans>  <global-exceptions />
  <global-forwards />
  <action-mappings >
    <action
      
      name="accountForm"
      path="/accountlogin"
      scope="request"
      type="com.Account.struts.action.AccountAction" >
          <forward name="ToaccountMain" path="/accountMain.jsp"> </forward>
          <forward name="loginfailure" path="/Loginfailure.jsp"> </forward>
          <forward name="loginfailure3times" path="/LoginFailure3times.jsp"> </forward>
      </action>
    <action
      name="accountForm"
      path="/dothings"
      scope="request"
      type="com.Account.struts.action.AccountFunctionAction" >
          <forward name="tobalance" path="/balance.jsp"> </forward>
          <forward name="failure" path="/nosuccess.jsp"> </forward>
          <forward name="toaccountMain" path="/accountMain.jsp"> </forward>
          <forward name="todeposit" path="/deposit.jsp"> </forward>
          <forward name="tomain" path="/accountMain.jsp"> </forward>
          <forward name="todrawmoney" path="/drawMoney.jsp"> </forward>
          <forward name="toPwd" path="/upPassword.jsp"> </forward>
          <forward name="toTransferAccount" path="/TransferAccount.jsp"> </forward>
          <forward name="toAccountEmpty" path="/accountEmpty.jsp"> </forward>
          <forward name="toTransferAccountAgree" path="/TransferAccountAgree.jsp"> </forward>
          <forward name="toTransferAccountSuccess" path="/TransferAccountSuccess.jsp"> </forward>
      </action>  </action-mappings>  <message-resources parameter="com.Account.struts.ApplicationResources" />
</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" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee   http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
  <filter>
   <filter-name>characterEncoding</filter-name>
   <filter-class>com.Account.struts.filter.CharFilter</filter-class>
  </filter>
   <filter-mapping>
   <filter-name>characterEncoding</filter-name>
   <url-pattern>/*</url-pattern>
   </filter-mapping>
  <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>

解决方案 »

  1.   

    你的taglib呢?在
      <servlet-mapping>
        <servlet-name>action </servlet-name>
        <url-pattern>*.do </url-pattern>
      </servlet-mapping> 
    加上<taglib>
    <taglib-uri>/WEB-INF/tld/struts-bean.tld</taglib-uri>
    <taglib-location>/WEB-INF/tld/struts-bean.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/tld/struts-html.tld</taglib-uri>
    <taglib-location>/WEB-INF/tld/struts-html.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/tld/struts-logic.tld</taglib-uri>
    <taglib-location>/WEB-INF/tld/struts-logic.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/tld/struts-nested.tld</taglib-uri>
    <taglib-location>
    /WEB-INF/tld/struts-nested.tld
    </taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/tld/struts-template.tld</taglib-uri>
    <taglib-location>
    /WEB-INF/tld/struts-template.tld
    </taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/tld/struts-tiles.tld</taglib-uri>
    <taglib-location>/WEB-INF/tld/struts-tiles.tld</taglib-location>
    </taglib>
      

  2.   

    我晕,楼上的,为什么要加上taglib?
    页面没有使用时,根本不需要加入
      

  3.   


    对,我没有用到那个 一开始我是用myeclispe做的啊  会不会 单独用tomcat发布要打包成war??
      

  4.   

    看一下登录页面中的action值是否正确,看你的意思应该是"accountlogin.do"吧,如果这里没错那就应该是action跳转出错了,看一下跳转的地方在配置文件里是否配上了,可能你打错字了^_^,暂时就想到那么多!!!
      

  5.   


    我发布时,一般都是export成一个war,然后把这个war放到tomcat的webapps下面。然后启动tomcat,就完了。好像还没有出错过。可能是我运气好。
      

  6.   

    先在你的项目中放一个简单的jsp页面
    直接访问jsp的地址,如果能访问jsp页面,则是你是struts-config文件配置错误
    如果不能访问jsp页面,则是你的tomcat或者是你的项目有问题
    呵呵