Java 应用程序部署在jboss上,但在尝试访问时出现404错误
因此,我已经在JBOSS(Linux box)上部署了我的应用程序,当我尝试访问URL时,它会给我404错误。 我已经在本地JBOSS上部署和测试了同一个应用程序,它工作得非常完美。 My Web.xml文件:Java 应用程序部署在jboss上,但在尝试访问时出现404错误,java,spring,maven,jboss,Java,Spring,Maven,Jboss,因此,我已经在JBOSS(Linux box)上部署了我的应用程序,当我尝试访问URL时,它会给我404错误。 我已经在本地JBOSS上部署和测试了同一个应用程序,它工作得非常完美。 My 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:schemaLocati
<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>
服务器状态监视
WEB-INF\jsp\systemsettings\serverStatus.jsp
org.springframework.web.context.ContextLoaderListener
上下文配置位置
classpath*:WEB-INF/spring-mvc-servlet.xml
春季mvc
org.springframework.web.servlet.DispatcherServlet
1.
春季mvc
*.做
http://displaytag.sf.net
/WEB-INF/tlds/displaytag.tld
/网格标签
/WEB-INF/tlds/grid-converter-changed.tld
我的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-INF/jsp/systemsettings/
.jsp
我们可以在您的web.xml中看到
您正在使用WEB-INF\jsp\systemsettings\serverStatus.jsp
您应该使用WEB-INF/jsp/systemsettings/serverStatus.jsp
在本地和服务器上发布您正在尝试的url,而不是使用“\”“/”。这是因为您将应用程序部署在服务器的不同上下文路径中,还是作为根本地应用程序部署在我尝试在linux box中使用的linux box上?您认为您是在服务器监控上下文中部署的吗?服务器日志中是否有任何异常或其他注释?问题已解决。此应用程序的SpringMVCServlet与其他应用程序的SpringMVCServlet之间存在一些冲突。还有,“/”不寻常的“\”问题