0

I am trying to add a simple jsp rendering in my spring boot application.

@Controller public class WelcomeController { @RequestMapping("/index") public String loginMessage(){ return "index"; } } 

resolver

spring.mvc.view.prefix=/WEB-INF/jsp/ spring.mvc.view.suffix=.jsp 

and /src/main/webapp/WEB-INF/jsp/index.jsp

I added both sprng boot web stater and tomcat embed

compile('org.springframework.boot:spring-boot-starter-web') compile('org.apache.tomcat.embed:tomcat-embed-jasper') 

I am facing this issue

May 11, 2018 3:54:53 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [java.lang.NoClassDefFoundError: org/apache/tomcat/util/security/Escape] with root cause java.lang.ClassNotFoundException: org.apache.tomcat.util.security.Escape 

1 Answer 1

1

I fixed this by using compileOnly

compile('org.springframework.boot:spring-boot-starter-web') compileOnly('org.apache.tomcat.embed:tomcat-embed-jasper') 

compile only is similar to scope provided in maven.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.