• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP error page

 
Victor Maehira
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good morning!
I�m trying to solve the javabeat mock exams! I have a doubt in the following question:

How can a servlet call a JSP error page?

A. This capability is not supported.
B. When the servlet throws the exception, it will automatically be caught by the calling JSP page.
C. The servlet needs to forward the request to the specific error page URL. The exception is passed along as an attribute named "javax.servlet.jsp.jspException".
D. The servlet needs to redirect the response to the specific error page, saving the exception off in a cookie

The correct answer is (D)! The first part of the answer is very clear: "The servlet needs to redirect the response to the specific error page", however, the second part doesn�t make sense to me: "saving the exception off in a cookie"! Why do I have to save the exception? And, what�s the relation with cookie? Is it mandatory?

Thanks!
[ March 13, 2007: Message edited by: Victor Maehira ]
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know what to say other than that I agree with you, Victor.
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
obviously a and b are worng.
i checked c, into the API and the spec, but didnt find anything saying what 'c' says. 'd' makes no sense.

this is question is weird.
 
Victor Maehira
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I guess some question we should answer by exclusion, choosing the most appropriate! I must get used to it!
Thank you!
 
Amirr Rafique
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What can be most appropriate answer
 
Seenikkannan krishnasamy
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The status code of the response always should set for a Servlet that throws or send an error...

Thanks,
Seenikkannan.K
 
Amirr Rafique
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seenikkannan

Can you please ellaborate bit more

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic