내 디스패처-servlet.xml에왜 내 JSP보기가 해결되지 않습니까?
<?xml version="1.0" encoding="UTF-8"?>
<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:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="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
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<mvc:annotation-driven/>
<context:component-scan base-package="com.example" />
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:prefix="/WEB-INF/views/" p:suffix=".jsp" p:viewClass="org.springframework.web.servlet.view.JstlView"/>
</beans>
는 그리고 이것은 내 컨트롤러
package com.example.spring;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@Controller
public class HelloController {
@RequestMapping("/form.htm")
public ModelAndView hello(Model model) {
return new ModelAndView("index");
}
}
내가 디버그 응용 프로그램이있을 때 내 콘솔에서 볼 수 있습니다.
WARNING: No mapping found for HTTP request with URI [/WEB-INF/views/index.jsp] in DispatcherServlet with name 'dispatcher'
컨트롤러가 히트 한 다음보기를 반환하지만 해결할 수 없습니다.
당신은 web.xml의 디스패처 서블릿 매핑 매핑을 게시 할 수 있습니까 –
이 질문을보십시오 : http://stackoverflow.com/questions/1266303/no-mapping-found-for-http-request-with-uri -web-inf-pages-apiform-jsp – Javi
프로젝트의 구조와 web.xml을 게시 할 수 있습니까? – chris