Solved

jsp - error page

Posted on 2001-06-19
7
329 Views
Last Modified: 2010-03-31
Im trying to use Errorpage.
In the main page I wrote:
<%@ page errorPage="Error.jsp"%>
In the Error.jsp I wrote:
<%@ page isErrorPage="true"%>

I tried to use the Exception object, for example:
<%=exception.toString()%>
But I couldnt.
What else should I add to get the exception object in Error.jsp?
(The browser gets to the right page "Error.jsp" does all the other things in the page except getting the Exception object).
0
Comment
Question by:uri22
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 1

Expert Comment

by:paragm
ID: 6207200
HI,

 You need to throw the exception initializing it with some value.
0
 
LVL 1

Author Comment

by:uri22
ID: 6209279
I forgot to write this in the original question,
I wrote:
<% if(x==null){
       throw new Exception("x=null);
} %>

It didnt work, how do I supose to throw this exception?
0
 
LVL 1

Accepted Solution

by:
rajendra_rathod earned 50 total points
ID: 6217247
In my case i have used following lines and are working fine
<%@ page language="java"  import="java.sql.*,java.net.*, Validation" errorPage="error.jsp"%>

error.jsp
<%@ page language="java" isErrorPage="true"%>
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:klaetu
ID: 6448138
Please accept a comment or a proposed answer to this question- if not, please comment as to why not or delete it.

Thanks
Klaetu, EE Community Moderator
0
 
LVL 5

Expert Comment

by:Netminder
ID: 6797046
There has been no activity in this question in quite some time, and it looks like it has been abandoned. As part of our ongoing mission to clean up the topic areas, a Moderator will finalize this question within the next seven (7) days. At that time, either I or one of the other Moderators will force/accept the comment of rajendra_rathod.

DO NOT ACCEPT THIS COMMENT AS AN ANSWER. If you have further comments on this question or the recommendation, please leave them here.

Thanks,

Netminder
Community Support Moderator
Experts Exchange
0
 
LVL 5

Expert Comment

by:Netminder
ID: 6821314
Force/accepted by

Netminder
Community Support Moderator
Experts Exchange
 
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question