728x90

Spring boot 3.x 버전 jstl 에러

 

Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.

Wed Nov 08 13:23:16 KST 2023
There was an unexpected error (type=Internal Server Error, status=500).
The absolute uri: [http://java.sun.com/jsp/jstl/core] cannot be resolved in either web.xml or the jar files deployed with this application
org.apache.jasper.JasperException: The absolute uri: [http://java.sun.com/jsp/jstl/core] cannot be resolved in either web.xml or the jar files deployed with this application
	at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:54)
	at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:294)
	at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:81)
	at org.apache.jasper.compiler.TagLibraryInfoImpl.generateTldResourcePath(TagLibraryInfoImpl.java:251)
	at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:122)
	at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:429)
	at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:487)
	at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1444)
	at org.apache.jasper.compiler.Parser.parse(Parser.java:138)
	at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:245)
	at org.apache.jasper.compiler.ParserController.parse(ParserController.java:106)
	at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:211)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:396)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:372)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:356)
	at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:603)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:396)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:380)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:328)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:814)
    ...

 

spring boot의 내장 톰켓의 버전이 9.x에서 10.x로 변경되어서 의존성 라이브러리 변경이 필요하다.

spring boot 시작시 로그에서 확인가능

2023-11-08T13:25:59.432+09:00  INFO 404506 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2023-11-08T13:25:59.442+09:00  INFO 404506 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2023-11-08T13:25:59.443+09:00  INFO 404506 --- [  restartedMain] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.5]

 

gradle에서 라이브러리는 변경한다.

//기존
//implementation 'org.apache.tomcat.embed:tomcat-embed-jasper'
//implementation 'org.springframework.security:spring-security-taglibs'
//변경
implementation 'org.apache.tomcat.embed:tomcat-embed-jasper'
implementation 'jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api'
implementation 'org.glassfish.web:jakarta.servlet.jsp.jstl'

 

728x90

+ Recent posts