项目本地正常上传到空间上(Resin 3.0.19)jsp可以访问,action访问不了,报404错误。
本地服务器:    Resin 3.1.6
空间上的服务器:
Resin 3.0.19
JDK 1.6.0
Servlet 2.4
(支持JSP 2.0标准)项目采用 Struts 2.2.1+Spring3.0+SpringSecurity3.0+hibernate3.2
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" 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">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/applicationContext*.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener> <listener>
<listener-class>
org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>
</listener>
<!-- 著名 Character Encoding filter -->
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter> <!-- springSecurity  -->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<!-- 拦截所有的请求 -->
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping> <filter>
<filter-name>struts-cleanup</filter-name>
<filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
</filter>
<filter-mapping>
<filter-name>struts-cleanup</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- 定义Struts2的FilterDispathcer的Filter -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<!-- FilterDispatcher用来初始化struts2并且处理所有的WEB请求。 -->
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>ct_xc.htm</welcome-file> <welcome-file>about.htm</welcome-file>
<welcome-file>product.htm</welcome-file>
<welcome-file>news.htm</welcome-file>
<welcome-file>consultant.htm</welcome-file>
<welcome-file>job.htm</welcome-file>
<welcome-file>contact.htm</welcome-file> <welcome-file>index.jsp</welcome-file>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
</web-app>
resin-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://caucho.com/ns/resin" xmlns:resin="http://caucho.com/ns/resin/core"> <servlet-mapping url-pattern='/struts/*' servlet-name='plugin_match' />
<servlet-mapping url-pattern='/other/*' servlet-name='plugin_match' />
<servlet-mapping url-pattern='*.action' servlet-name='plugin_match' />
<servlet-mapping url-pattern='*.html' servlet-name='plugin_match' />
<servlet-mapping url-pattern='*.do' servlet-name='plugin_match' />
<servlet-mapping url-pattern='/dwr/*' servlet-name='plugin_match' /></web-app>项目地址:
http://hj.chengtuo.net/manage/login/
http://hj.chengtuo.net/manage/mainFrame.do这个问题困扰我好几天了,希望有高手帮忙。

解决方案 »

  1.   

    服务器启动正常。现在只有jsp可以访问,action访问不到。
      

  2.   

    确定是web项目没有正常启动...
    看下配置文件的路径吧。
    或者web.xml的配置是不是又不标准的地方,tomcat十个容错性很强的服务器,你有时候写错了,也能帮你改正,但是其他服务器可能不强了
      

  3.   

    web.xml配置没有错,服务器也正常。
    这几天也在网上找了些资料得出结论:
    默认情况resin ResinConfigServer配置不支持除了jsp和servlet之外的其他不规则映射,apache对此类URL会返回404,或者无效的servlet,这就用到了resin的plugin_match配置。
    如:
    <servlet-mapping url-pattern="*.do" servlet-name="plugin_match"/>网上说只要配置resin-web.xml就可了。
    我也配了,可以还是不行。