Solved

jsp - error page

Posted on 2001-06-19
7
318 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
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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 

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: 6758567
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Java SE 8u111  Lot of stuff broke 11 69
Spring Framework HTTPSession management 1 36
diffSum example 4 37
oracle 11g 23 84
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

809 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