我通過運行問題進行了ModelAndView中找不到JSP視圖春天的ModelAndView沒有找到JSP頁面 - 請求的資源不可用
以下是CONTROLER
@Controller
public class BasicController {
private String GUID;
@RequestMapping(value = "/basicLti.spr", method = RequestMethod.GET)
public ModelAndView view(@RequestParam(value = ORG_IDS_ATTRIBUTE, required = false) String orgIds) {
ModelAndView mav = new ModelAndView();
String GUID="one";
if(orgIds != null) {
mav = new ModelAndView("sso-auth-tool");
mav.addObject(userId, "36bdf294-2832-4179-b9e4-b4e2148fb048");
mav.addObject(GUID,"String");
mav.addObject(ORG_IDS_ATTRIBUTE, "512488b9-a387-45b0-b7c6-d514d112566e");
return mav;
}
System.out.println("here i am");
}
}
我有JSP教職員如下:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
</head>
<body>
<!--[if IE]>
<form name="formLogin" action="${ssoUrl}" method="post" target="_blank">
<p id="message" style="visibility:hidden;">Your Starrmatica course has been opened in a new window.</p>
<![endif]-->
<!--[if !IE]>-->
<p>Got Message</p>
<input type='hidden' name='iqity_id' value='${user_id}'>
<input type="hidden" name="school_id" value="${school_id}">
<input type="submit" name="guid_key" value="${guid_key}">
<!-- <input type="submit" id="sas-auth-tool" value="Authenticate Resources" name="submit" /> -->
</form>
</body>
</html>
的servlet-context.xml文件
<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>
現在它沒有找到asso.jsp - HTTP 404錯誤! 我的問題是; 我如何評估jsp文件?
WEB.XML
<?xml version="1.0" encoding="UTF-8"?>
<!-- Use this definition if using a Java EE 6 container This also stops Eclipse
from complaining that 3.0 is not a valid version <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> -->
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<!-- The definition of the Root Spring Container shared by all Servlets
and Filters -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/root-context.xml</param-value>
</context-param>
<!-- Creates the Spring Container shared by all Servlets and Filters -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- Processes application requests -->
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/app/servlet-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>
org.apache.cxf.transport.servlet.CXFServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>*.spr</url-pattern>
</servlet-mapping>
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/WEB-INF/error.jsp</location>
</error-page>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
發表您的web.xml文件和HTML包含鏈接服務器返回 –
是否文件'/ WEB-INF /視圖/ SSO-AUTH-tool.jsp'存在於您的部署web應用? – jalynn2
是/WEB-INF/views/sso-auth-tool.jsp存在於e = deploy webapp中。 – Thunder