This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFSJ Page 471:

 
amarshi mohanty
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
 
Ankit Garg
Sheriff
Posts: 9509
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 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..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic