Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

jsp - error page

Posted on 2001-06-19
7
Medium Priority
?
338 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 200 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
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Suggested Courses

721 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