How do I have common error page templates with tiles in a Spring/MVC 3.0 app?

前端 未结 2 1235
心在旅途
心在旅途 2021-01-04 02:59

I have a Spring MVC/3.0 app using tiles as it\'s view, this is working fine however I can\'t figure out how to get the error pages to also use tiles.

I have in my

2条回答
  •  时光说笑
    2021-01-04 03:32

    You need to add the "layouted" jsp in your web.xml. Below is the explaination code:

    // Your web.xml should look like this:
    
      404
      /WEB-INF/error/layout-404.jsp
    
    
    
    // Your layout-404.jsp should look like this:
    <%@page isELIgnored="false" %>
    <%@page contentType="text/html"%>
    <%@taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
        
    
    
    // Your layout def should look like this:
    
      
    
    

提交回复
热议问题