JspException and PageContext cannot be resolved

后端 未结 7 1967
眼角桃花
眼角桃花 2020-12-29 09:09

This is a follow up to a question on accessing resources in jsp page of spring mvc app Thanks to @kmb385 I was able to resolve that problem but now I get the following eclip

7条回答
  •  抹茶落季
    2020-12-29 09:48

    Add to the pom.xml dependencies:

         
            javax.servlet
            servlet-api
            2.5
            provided
        
        
            javax.servlet.jsp
            jsp-api
            2.1
            provided
        
    

    JSP:

    Make sure to add on jsp, before tag:

    <%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    

    Get the context on JSP:

    
    

    Import style css:

    
    

    Dispatcher-servlet:

    On your "spring-dispatcher-servlet.xml" add the following lines:

    
    
    
    

    Maybe, you need to add this adapters:

    
     [Optional]
    
        
      
    

    explained here: how to include js and css in jsp with spring MVC

提交回复
热议问题