Core Java| JSP| Servlets| XML| EJB| JEE5| Web Services| J2ME| Glossary| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Generate Error in JSP 
 

In software engineering, the term refers to an incorrect action or calculation performed by software.

 

Generate Error in JSP

                          

In software engineering, the term refers to an incorrect action or calculation performed by software. In general we can say that the error results from a combination of a defect and a fault. If, as a result of the error, the system performs an undesired actions or fails to perform a desired action, then this is referred as a failure. 

An error may be detected by the software which can be handled by raising an exception. eg. 404 or Not found error message is an Http standard response code indicating that the server either could not find what was requested. These errors messages are generated by the browsers. In HTTP error 500, the web server encountered an unexpected condition that prevented it from fulfilling the request by the client. There are many more Http errors codes available. They are not discussed in this example.

The code of the program is given below:

 

<HTML>
  <HEAD><TITLE>Generate Error in jsp</TITLE></HEAD>
  <BODY>
    This page generates an error when you click the button.<P>
    <FORM METHOD="POST" ACTION="ErrorPagr.jsp">
      <INPUT TYPE="HIDDEN" NAME="errorValue" VALUE="error">
      <INPUT TYPE="SUBMIT" VALUE="Generate exception!">
    </FORM>
  </BODY>
</HTML>

 

<%
  String hiddenvalue = request.getParameter("errorValue");
  if ( hiddenvalue.equals("error"))
    throw new java.lang.NullPointerException();
%>

Output of the Program:

 

Download this example.

                          

» View all related tutorials
Related Tags: c jsp ide variables script object io methods scope method variable print ip page tag ole instance int ria this

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Training Courses
Tell A Friend
Your Friend Name
Software Solutions
Least Viewed
Most Rated
Recently Viewed
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.