• 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

JSP error page  RSS feed

 
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 ]
 
pie sneak
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.
 
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!
 
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What can be most appropriate answer
 
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
 
And then we all jump out and yell "surprise! we got you this tiny ad!"
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!