How to redirect to external website on 404 Tomcat

前端 未结 1 772
旧时难觅i
旧时难觅i 2021-01-24 02:24

I am using spring 3 + Tomcat 7

In web.xml I have defined


    404
    

        
1条回答
  •  时光说笑
    2021-01-24 02:47

    I am not sure whether giving the direct url in location will work. But you can put a jsp there and redirect to the url from the jsp.

    
        404
        /filenotfound.jsp
    
    

    filenotfound.jsp

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

    0 讨论(0)
提交回复
热议问题