繁体   English   中英

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

[英]Application deployed on jboss but gives 404 error when i try to access

因此,我已将应用程序部署在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>

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

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

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

代替“ \\”使用“ /”

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM