Spring 为什么JSP视图没有被解析?
我正在尝试使用Servlet3.0在Tomcat7.0.42上部署SpringWeb应用程序。该应用程序的默认主页可以正常打开,但当我尝试从主页导航时,我得到的是404。请在下面查找详细信息 我的servlet-contex.xmlSpring 为什么JSP视图没有被解析?,spring,jsp,spring-mvc,Spring,Jsp,Spring Mvc,我正在尝试使用Servlet3.0在Tomcat7.0.42上部署SpringWeb应用程序。该应用程序的默认主页可以正常打开,但当我尝试从主页导航时,我得到的是404。请在下面查找详细信息 我的servlet-contex.xml <?xml version="1.0" encoding="UTF-8"?> <beans:beans xmlns="http://www.springframework.org/schema/mvc" xmlns:xsi="http://
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<beans:property name="prefix" value="/WEB-INF/views/" />
<beans:property name="suffix" value=".jsp" />
</beans:bean>
<context:component-scan base-package="com.portfolio.chota" />
</beans:beans>
当我访问应用程序时,主页加载正常,但当我尝试从主页移动到/配置文件时,我得到以下404
Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36 404 /abc/profile
问题已解决
我发现问题出在这些位置的cpjkmount.conf文件上-
JkMount /*.jsp ajp13
JkMount /*.do ajp13
我现在已将此更新为
JkMount /* ajp13
由于这个域只承载纯基于java的应用程序,所以我的所有请求现在都被提供给Tomcat&因此我的问题得到了解决
希望这对你们中的某些人也有帮助。你们有用于
/sessionOut
的处理程序吗?你们有用于war的/WEB-INF/VIEWS/profile.jsp吗?@AliDehghani是的,有一个用于/sessionOut的处理程序。@Pulkit是的,jsp页面在war中。在你们的帖子中添加两件事[1]你们用来启动主页的完整URL[2]主页上的链接指向的完整URL。
JkMount /*.jsp ajp13
JkMount /*.do ajp13
JkMount /* ajp13