IE下java配置404、500页面

来源:互联网 发布:interbase数据库说明书 编辑:程序博客网 时间:2024/06/06 05:03

1、在web.xml里面配置,因为IE要配置中间页面转一下才能正常显示,火狐正常。

<error-page>

       <error-code>404</error-code>

       <location>/http_error.jsp</location>

</error-page>

<error-page>

       <error-code>500</error-code>

       <location>/http_error.jsp</location>

</error-page>

2、转换页面

<%

       Integer code = (Integer)request.getAttribute("javax.servlet.error.status_code");

    if(code==404){

        response.sendRedirect(request.getContextPath()+"/404.jsp");

    }else if(code==500){

        response.sendRedirect(request.getContextPath()+"/500.jsp");

    }

%>

0 0
原创粉丝点击