天天看點

servlet action is not available

Servlet action is not available解決方法

問題原因:

1.、web.xml檔案中未配置ActionServlet。

2、struts-config.xml檔案未配置你要通路的Action。

3、你的jsp檔案form标記中action屬性的路徑名稱錯誤。

針對以上3種情況相應的解決方案如下:

1、在web.xml檔案中加上ActionServlet的配置資訊

    action

    org.apache.struts.action.ActionServlet

      config

      /WEB-INF/struts-config.xml

      debug

      detail

    2

2、在struts-config.xml檔案檢查你要通路的Action配置檔案。

3、檢查jsp檔案form标記中action屬性的路徑名稱是否與struts-config.xml檔案中action标記的path屬性的路徑名稱一緻。

--------------------------------------------------------------------------------

Spring 錯誤

去掉struts配置檔案中的datasource配置

1  試一下拷貝commons-beanutils.jar和commons-digester.jar到WEB-INF\lib.

2  <plug-in

        className="org.springframework.web.struts.ContextLoaderPlugIn">

        <set-property property="contextConfigLocation"

            value="/WEB-INF/classes/applicationContext.xml" />

    </plug-in>

applicationContext.xml的位置錯了

3 在spring的配置檔案下的插入hibernate的配置檔案路徑錯誤

4 還有就是一定要在struts配置檔案中加: <controller processorClass="org.springframework.web.struts.DelegatingRequestProcessor"/>。這樣你的action才能真的委托給spring。

5 myeclipse沒有把spring.jar拷貝到lib下

--------------------------------------------------------------------------------------

非以上情況的解決辦法就是檢查web容器的log日志,如果時tomcat則檢查下logs目錄下的localhost_log檔案,看裡邊是否記錄有錯誤資訊,然後根據錯誤資訊提示将其糾正。

本文轉自左正部落格園部落格,原文連結:http://www.cnblogs.com/soundcode/archive/2010/12/20/1911886.html,如需轉載請自行聯系原作者