惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
H
Help Net Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
Vulnerabilities – Threatpost
MongoDB | Blog
MongoDB | Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
A
Arctic Wolf
The GitHub Blog
The GitHub Blog
Security Latest
Security Latest
G
GRAHAM CLULEY
Cyberwarzone
Cyberwarzone
S
Schneier on Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
P
Privacy & Cybersecurity Law Blog
IT之家
IT之家
D
Darknet – Hacking Tools, Hacker News & Cyber Security
博客园 - 聂微东
T
Threat Research - Cisco Blogs
AWS News Blog
AWS News Blog
The Hacker News
The Hacker News
B
Blog RSS Feed
云风的 BLOG
云风的 BLOG
Scott Helme
Scott Helme
P
Proofpoint News Feed
T
The Exploit Database - CXSecurity.com
L
LangChain Blog
F
Full Disclosure
I
Intezer
V
V2EX
C
Cyber Attacks, Cyber Crime and Cyber Security
Cisco Talos Blog
Cisco Talos Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Spread Privacy
Spread Privacy
美团技术团队
Engineering at Meta
Engineering at Meta
C
Cybersecurity and Infrastructure Security Agency CISA
罗磊的独立博客
T
Tenable Blog
D
DataBreaches.Net
M
MIT News - Artificial intelligence
S
Securelist
C
CERT Recently Published Vulnerability Notes
Recent Announcements
Recent Announcements
Microsoft Azure Blog
Microsoft Azure Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
NISL@THU
NISL@THU
The Register - Security
The Register - Security
L
LINUX DO - 热门话题
P
Palo Alto Networks Blog

博客园 - Valen

命令方式启动SQL服务 tomcat中显示文件目录 equals中NullPointerException问题解决 - Valen - 博客园 JSTL与EL表达式简单应用 - Valen - 博客园 Jsp重定向forward和sendRedirect的区别 Java,Hibernate,Sql之间数据类型对应表 转:Java调用正则表达式 - Valen - 博客园 Jsp中EL表达式不能显示的解决方法 JAVA读取Properties的六种方法 Install JSEclipse Method 备份你的手机通讯录到网络吧! vsftpd 配置 解决fedora11 root用户登录问题 Windows与Vmware下的Linux文件共享方法 Windows Live 设置 雷人签名 ob_start 用法 分页算法(1) 小沈阳 "不差钱" 改编版
Jsp中errorPage使用及web.xml配置 - Valen - 博客园
Valen · 2009-09-24 · via 博客园 - Valen

建立2个页面

1个为index.jsp 设置<%@ page="java" errorPage="error.jsp" %>代表出错后跳转到哪个页面
在本页面输出<%=i %> 跳转不到指定页面是因为没有配置web.xml,下面有配置web.xml的方法

1个位error.jsp 设置<%@ page="java" isErrorPage="true" %>代表此页面接到Exception后由该页面处理

<%=exception.toString() %>      
<%=exception.getMessage() %>      打印异常信息

一.   通过错误码来配置error-page

<error-page>
        <error-code>500</error-code>
        <location>/error.jsp</location>
  </error-page>

上面配置了当系统发生500错误(即服务器内部错误)时,跳转到错误处理页面error.jsp

二.   通过异常的类型配置error-page

Eg.

<error-page>
        <exception-type>java.lang.NullException</exception-type>
        <location>/error.jsp</location>
   </error-page>

上面配置了当系统发生java.lang.NullException(即空指针异常)时,跳转到错误处理页面error.jsp