2017-03-15 2 views
0

그래서 Spring Boot Sample Web JSP 예제를 꺼 냈습니다. Eclipse로 가져 왔고 POM을 수정하여 부모 POM을 제대로 가져 왔지만 나머지는 그대로 둡니다. 그러나 URL을 클릭하면 404가됩니다. 아래는 POM이며 내가 변경 한 유일한 것입니다. Eclipse Luna를 사용하여 Spring App으로 실행하고있다. 로그가 찾을 수없는 것 이외의 다른 것을 보여주지 못했습니다. 컨트롤러의 메서드가 호출되는 것을 확인 했으므로 "환영"뷰 이름이 반환되었습니다.봄 부팅 1.5.2 샘플 반환 404

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <parent> 
     <!-- Your own application should inherit from spring-boot-starter-parent --> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-parent</artifactId> 
     <version>1.5.2.RELEASE</version> 
     <relativePath /> 
    </parent> 
    <artifactId>spring-boot-sample-web-jsp</artifactId> 
    <packaging>war</packaging> 
    <name>Spring Boot Web JSP Sample</name> 
    <description>Spring Boot Web JSP Sample</description> 
    <url>http://projects.spring.io/spring-boot/</url> 
    <organization> 
     <name>Pivotal Software, Inc.</name> 
     <url>http://www.spring.io</url> 
    </organization> 
    <properties> 
     <java.version>1.7</java.version> 
     <main.basedir>${basedir}/../..</main.basedir> 
     <m2eclipse.wtp.contextRoot>/</m2eclipse.wtp.contextRoot> 
    </properties> 
    <dependencies> 
     <!-- Compile --> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-web</artifactId> 
     </dependency> 
     <dependency> 
      <groupId>javax.servlet</groupId> 
      <artifactId>jstl</artifactId> 
     </dependency> 
     <!-- Provided --> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-tomcat</artifactId> 
      <scope>provided</scope> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.tomcat.embed</groupId> 
      <artifactId>tomcat-embed-jasper</artifactId> 
      <scope>provided</scope> 
     </dependency> 
     <!-- Test --> 
     <dependency> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-starter-test</artifactId> 
      <scope>test</scope> 
     </dependency> 
    </dependencies> 
    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.springframework.boot</groupId> 
       <artifactId>spring-boot-maven-plugin</artifactId> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-surefire-plugin</artifactId> 
       <configuration> 
        <useSystemClassLoader>false</useSystemClassLoader> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 
</project> 

는 그리고 이것은 내 로그 spring-boot-starter-tomcattomcat-embed-jasper<scope>provide</scope> 요소를 제거하는

.w.s.m.m.a.ServletInvocableHandlerMethod : Method [sample.jsp.WelcomeController.welcome] returned [welcome] 
o.s.w.s.v.ContentNegotiatingViewResolver : Requested media types are [text/html, application/xhtml+xml, image/webp, application/xml;q=0.9, */*;q=0.8] based on Accept header types and producible media types [*/*]) 
o.s.w.servlet.view.BeanNameViewResolver : No matching bean found for view name 'welcome' 
o.s.b.f.s.DefaultListableBeanFactory  : Invoking afterPropertiesSet() on bean with name 'welcome' 
o.s.w.s.v.InternalResourceViewResolver : Cached view [welcome] 
o.s.w.s.v.ContentNegotiatingViewResolver : Returning [org.springframework.web.servlet.view.JstlView: name 'welcome'; URL [/WEB-INF/jsp/welcome.jsp]] based on requested media type 'text/html' 
o.s.web.servlet.DispatcherServlet  : Rendering view [org.springframework.web.servlet.view.JstlView: name 'welcome'; URL [/WEB-INF/jsp/welcome.jsp]] in DispatcherServlet with name 'dispatcherServlet' 
o.s.web.servlet.view.JstlView   : Rendering view with name 'welcome' with model {time=Wed Mar 15 13:59:42 EDT 2017, message=Hello Phil} and static attributes {} 
o.s.web.servlet.view.JstlView   : Added model object 'time' of type [java.util.Date] to request in view with name 'welcome' 
o.s.web.servlet.view.JstlView   : Added model object 'message' of type [java.lang.String] to request in view with name 'welcome' 
o.s.web.servlet.view.JstlView   : Forwarding to resource [/WEB-INF/jsp/welcome.jsp] in InternalResourceView 'welcome' 
o.apache.catalina.core.StandardWrapper : Returning non-STM instance 
o.s.web.servlet.DispatcherServlet  : Bound request context to thread: [email protected] 
o.s.web.servlet.DispatcherServlet  : DispatcherServlet with name 'dispatcherServlet' processing GET request for [/WEB-INF/jsp/welcome.jsp] 
o.s.web.servlet.DispatcherServlet  : Testing handler map [[email protected]6cee48] in DispatcherServlet with name 'dispatcherServlet' 
o.s.w.s.handler.SimpleUrlHandlerMapping : No handler mapping found for [/WEB-INF/jsp/welcome.jsp] 
o.s.web.servlet.DispatcherServlet  : Testing handler map [org.springframework[email protected]190641d] in DispatcherServlet with name 'dispatcherServlet' 
s.w.s.m.m.a.RequestMappingHandlerMapping : Looking up handler method for path /WEB-INF/jsp/welcome.jsp 
o.a.c.loader.WebappClassLoaderBase  : getResource(org/springframework/mail/javamail/mime.types) 
o.a.c.loader.WebappClassLoaderBase  : Delegating to parent classloader [email protected] 
o.a.c.loader.WebappClassLoaderBase  :  findResource(org/springframework/mail/javamail/mime.types) 
o.a.c.loader.WebappClassLoaderBase  :  --> Resource not found, returning null 
o.a.c.loader.WebappClassLoaderBase  : --> Resource not found, returning null 
.PathExtensionContentNegotiationStrategy : Loading default Java Activation Framework FileTypeMap 
javax.activation       : MimetypesFileTypeMap: load HOME 
javax.activation       : MimetypesFileTypeMap: load SYS 
javax.activation       : MimetypesFileTypeMap: load JAR 
o.a.c.loader.WebappClassLoaderBase  :  findResources(META-INF/mime.types) 
+0

나는 1.3.8.RELEASE 버전을 가져 왔으며 이것은 정상적으로 작동합니다. 그래서 제 빌드 프로세스는 괜찮습니다. 그러나 나는 1.5.2와 1.3.8의 차이점이 무엇인지에 대한 단서가 없다. –

답변

0

시도의 조각입니다. 이 문제도 만났으며이를 통해 내 문제를 해결했습니다.

+0

유망한 것으로 들립니다. 하지만 두 종속성을 모두 변경했으며, Maven Update Project를 수행하고 다시 빌드하고 나에게 404를 제공합니다. 아마 당신이 제안한 것과 매우 유사하고 관련이 있습니다. –