Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

HFSJ Page 471:

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

page 471 says:

<%@ page isErrorPage=”true” %>
<html><body>
<strong>Bummer.</strong>

You caused a ${pageContext.exception} on the server.


</body></html>

and then is explainns:
"Note: the exception implicit object is available ONLY to error pages with an explicitly-defined page directive:
<%@ page isErrorPage=”true” %>
In other words, configuring an error page in the DD is not enough to make the Container give that page the implicit exception object ".



I am not getting how Container gives the "exception " object?

thanks
Amarshi
 
Sheriff
Posts: 9671
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
amarshi when you post HTML in your message, check the "Disable HTML in this message" checkbox so that your post doesn't get screwed up.

When you set the isErrorPage="true", then the container created a scripting variable called exception in the generated servlet of the JSP page. If you don't specify the isErrorPage="true", you can still use the exception object using EL (as in your code) or pageContext scripting variable...
 
amarshi mohanty
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank Ankit..
 
The longest recorded flight time of a chicken is 13 seconds. But that was done without this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic