部署struts 2应用程序时出现jboss错误

时间:2013-10-29 15:40:27

标签: deployment struts2 jboss http-status-code-404

我已经在jboss上使用eclipse将我的struts 2应用程序部署为7。控制台显示没有错误,但当我尝试打开“localhost:8080 / site”时,我收到404页错误。我尝试从浏览器中获取一些资源,例如localhost:8080 / site / img / logo.png它运行良好,所以服务器工作正常,应用程序实际部署,但似乎我无法访问任何jsp文件。有任何想法吗? 相同的应用程序在Tomcat 7上运行良好。

这是web.xml

<?xml version="1.0" encoding="UTF-8"?><web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">

<display-name>versus</display-name>
<session-config>
    <session-timeout>240</session-timeout>
    <tracking-mode>COOKIE</tracking-mode>
</session-config>
<security-role> 
    <role-name>Denied</role-name>
</security-role> 

 <security-constraint> 
    <web-resource-collection> 
        <web-resource-name>Deny Direct Access</web-resource-name> 
        <url-pattern>*.pdf</url-pattern> 
    </web-resource-collection> 
    <auth-constraint>
        <role-name>Denied</role-name> 
    </auth-constraint> 
</security-constraint>

<filter>
    <filter-name>UrlRewriteFilter</filter-name>
    <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
    <init-param>
        <param-name>logLevel</param-name>
        <param-value>WARN</param-value>
    </init-param>
</filter>

<filter-mapping>
    <filter-name>UrlRewriteFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<filter>
    <filter-name>struts2</filter-name>
    <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>

<filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
</filter-mapping>
<welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
</welcome-file-list>

这是index.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%><%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Versus</title>
    <meta http-equiv="refresh" content="0;url=home?request_locale=en">
</head>
<body>          
</body> 
</html>

这是一个struts.xml的片段

<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="false" />
<constant name="struts.custom.i18n.resources" value="resources.ApplicationResources" />
<constant name="struts.locale" value="en" />
<constant name="struts.multipart.maxSize" value="10000000" />
<constant name="struts.i18n.encoding" value="ISO-8859-1" />


<package name="default" extends="struts-default">
    <!-- INTERCEPTOR -->
    <interceptors>
        <interceptor name="mobile" class="utils.MobileInterceptor" />
        <interceptor-stack name="myStack">
            <interceptor-ref name="mobile" />
            <interceptor-ref name="defaultStack" />
        </interceptor-stack>
    </interceptors>
    <default-interceptor-ref name="myStack" />

    <global-results>
        <result name="success">/jsp/template.jsp</result>
        <result name="input">/jsp/template.jsp</result>
        <result name="error">/jsp/error.jsp</result>
        <result name="none">/jsp/error.jsp</result>
    </global-results>

    <!-- GENERAL -->
    <action name="index" class="controller.ActionIndex" method="execute" />
    <action name="redirect" class="controller.ActionRedirect"
        method="execute" />
    <action name="login" class="controller.ActionLogin" method="login">
        <result name="logged" type="redirectAction">redirect?request_locale=it&amp;page=${page}&amp;l4vUserLat=${l4vUserLat}&amp;l4vUserLon=${l4vUserLon}
        </result>
    </action>

    <action name="logout" class="controller.ActionLogin" method="logout" />

0 个答案:

没有答案