应用程序部署在jboss上但在我尝试访问时出现404错误

时间:2012-12-13 07:13:50

标签: java spring maven jboss

所以,我已经在JBOSS(Linux盒子)上部署了我的应用程序,当我尝试访问URL时,它给了我404错误。 我已经在我当地的JBOSS上部署和测试了相同的应用程序并且运行完美。 我的Web.xml文件:

<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">

    <display-name>Server-status Monitoring</display-name>

    <welcome-file-list>
        <welcome-file>WEB-INF\jsp\systemsettings\serverStatus.jsp</welcome-file>
    </welcome-file-list>


    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath*:WEB-INF/spring-mvc-servlet.xml</param-value>
    </context-param>

    <servlet>
        <servlet-name>spring-mvc</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>spring-mvc</servlet-name>
        <url-pattern>*.do</url-pattern>
    </servlet-mapping>

    <jsp-config>

        <taglib>
            <taglib-uri>http://displaytag.sf.net</taglib-uri>
            <taglib-location>/WEB-INF/tlds/displaytag.tld</taglib-location>
        </taglib>

        <taglib>
            <taglib-uri>/gridtags</taglib-uri>
            <taglib-location>/WEB-INF/tlds/grid-converter-changed.tld</taglib-location>
        </taglib>


    </jsp-config>


</web-app>

我的spring-mvc-servlet.xml文件:

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
    xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://www.springframework.org/schema/context 
        http://www.springframework.org/schema/context/spring-context-2.5.xsd
        http://www.springframework.org/schema/aop
        http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">

    <bean name="/*.do" class="com.sterling.ag.controller.ServerStatusController">
        <property name="serverStatusFacade">
            <bean class="com.sterling.ag.facadeImpl.ServerStatusFacadeImpl" />
        </property>
    </bean>

    <bean id="viewResolver"
        class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix">
            <value>/WEB-INF/jsp/systemsettings/</value>
        </property>
        <property name="suffix">
            <value>.jsp</value>
        </property>
    </bean>


</beans>

1 个答案:

答案 0 :(得分:0)

正如我们在您的web.xml中看到的那样

您正在使用 WEB-INF \ jsp \ systemsettings \ serverStatus.jsp

你应该使用 WEB-INF / jsp / systemsettings / serverStatus.jsp

而不是&#34; \&#34; 使用&#34; /&#34;