Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Error Descrition through request Object  RSS feed

 
Deepan Devadasan
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi folks..

one of the over loaded methods to programmatically send Error codes with Description is as follows



where(in my case);
code- is a custom code (9893)
message- is a custom description (My own Error Description)

Please clarify how to get access to the description in the following

JSP, through
1) Scriptlet - with implicit request object
2) EL Expression

Servlet, through
request object

It is quite urgent guys


Thanks in advance

-----------------------
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Theepan Thevathasan:

It is quite urgent guys


Please read this to see why putting this in your post wasn't a good idea.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Scriptlet - with implicit request object
2) EL Expression

Servlet, through
request object


Obviously, your present code has only attached the message to the response. To attach it to the request, you will need another line of code - consult the ServletRequest javadocs to see what that should be.

A viable alternative would be to attach that msg to the session.
Bill
 
Deepan Devadasan
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
thanks for the reply..

i
To attach it to the request, you will need another line of code


i went javadoc, still unable to figure out...

but there is another similar method to send status code, where the intention in a non error code..


I agree about
alternative would be to attach that msg to the session


well, i came across sendError() while preparing SCWCD, on HeadFirst...

So I was wondering if there is a way for me to only get the description so that i can customize my error page dynamically with the message i pass with sendError(int sc, String SC).
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You did not previously mention that you were talking about an error page.

The error information is made available to an error page via scoped variables that are placed on the request for that page. See the Servlet Spec for details (section 9, if memory serves me correctly).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!