0
...에 매핑은 []의 DispatcherServlet에 파일을 사용할 수없는 동안 나는 또 다시이 오류를 받고 있어요
web.xml을
<web-app id="WebApp_ID" 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>brb</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>brb</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>brb</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
BRB -servlet.xml을
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.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"
default-lazy-init="false">
<context:component-scan base-package="spring"/>
<mvc:annotation-driven/>
<bean class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="prefix" value="" />
<property name="suffix" value="" />
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
</bean>
<bean name="simple" class="spring.SimpleBean">
<constructor-arg index="0" value="1"/>
<constructor-arg index="1" value="1"/>
</bean>
개
Controller 클래스는 다음과 같이이다 :
@Controller
public class BrbController{
@RequestMapping(value = "/", method = GET)
public String index() {
System.out.println(this.getClass().getClassLoader().getResource("index.jsp")); // i check is file is available, actually I've coppied it in all resource directories presented
return "index.jsp";
}
나는 임베디드 부두에서 실행이 간단한 응용 프로그램을 GER하기 위해 노력하고있어,하지만 어떤 이유로 스프링 MVC의 뷰 파일을 볼 수 없습니다.
UPDATE :
* what * URI를 사용하여 쿼리하는 중입니까? – Raedwald
죄송합니다. 그것을 압박하지 않았어. 그냥 localhost : 9123/ –
응용 프로그램을 루트에 매핑 했습니까? 즉, 'localhost : 9123 /'이 웹 앱을 해결합니까? 그렇지 않으면 도움이 될 수 있습니다 - http://stackoverflow.com/questions/8219148/how-to-map-a-servlet-filter-on-in-jetty – ramp