Change in JSP error handling in Tomcat5.0??

2005-03-01 Thread Graba, Jan
Hi.

While testing a JSP error page that was working fine 9 months ago, I found that 
the page is not now performing its function.
Instead of displaying an appropriate error message when the associated JSP 
receives alphabetic data instead of the integer data
that it is expecting, an HTTP 500 message saying that the data manipulation JSP 
cannot be displayed is generated by the browser. 

The simple application behaves fine when valid data is entered, and the JSP 
error page itself can be rendered directly (if a
suitable check is made for the implicit object 'exception' being equal to null).

Here is the (very ordinary) error page declaration line in the data 
manipulation JSP:
%@ page errorPage=AdderError.jsp %

Here is the (equally ordinary) associated line in the JSP error page:
%@ page isErrorPage=true %

The only changes that have taken place since I last tested these pages are the 
replacement of Java SDK1.4.2 with SDK1.5.0/5.0 and
the replacement of Tomcat 4.1 with Tomcat 5.0.

It seems highly unlikely that the change of SDK could have led to this problem, 
but I suppose that there may be some change to
Tomcat (or, more likely, version 2.4 of the servlet API) that has passed me by.

Can anybody shed light on the cause of this change in behaviour?

Any assistance would be greatly appreciated.

Cheers.
Jan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



JSP error handling

2002-11-06 Thread Jan Kunzmann
Hi there,

I've a problem with JSP error handling.

I tried to make custom error pages with the
% page errorPage=... % element. If an error occurs during the 
execution of my jsp page, the error page is called, but the 
javax.servlet.error.* attributes do not contain any values.

I looked into the Tomcat 4.0 source and found a valve called 
ErrorDispatcherValve. Has it something to do with jsp error handling? I 
tried to include the valve with Valve... and with Host 
errorReportingValve=, but the error page still reports the attributes 
to be null.

I use Tomcat 4.0.4 from the Debian distribution with marginal chances in 
server.xml.

Thanks in advance,
Jan


--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org



Re: JSP error handling

2002-11-06 Thread Ricardo Moral
There are two valves used to handle errors. The first
one is the ErrorDispatcherValve. This is the valve
that will forward the request to the error page if
there is a uncaught exception. The second valve is the
ErrorReportValve wich is the last valve on the list of
valves of a Host and is used to generate a error
report in HTML. 

You don't need to add this valves by hand because they
are added by the start method of the StandardHost
implementation. If you are using other implementation
of the Host interface you must add this valves
yourself.

The exception of JSP's are stored under the attibute
'javax.servlet.jsp.jspException' of the request. But
you must access this value directly using the
'exception' variable already declared on the context
of the error page.


--- Jan Kunzmann [EMAIL PROTECTED] wrote:
 Hi there,
 
 I've a problem with JSP error handling.
 
 I tried to make custom error pages with the
 % page errorPage=... % element. If an error
 occurs during the 
 execution of my jsp page, the error page is called,
 but the 
 javax.servlet.error.* attributes do not contain any
 values.
 
 I looked into the Tomcat 4.0 source and found a
 valve called 
 ErrorDispatcherValve. Has it something to do with
 jsp error handling? I 
 tried to include the valve with Valve... and with
 Host 
 errorReportingValve=, but the error page still
 reports the attributes 
 to be null.
 
 I use Tomcat 4.0.4 from the Debian distribution with
 marginal chances in 
 server.xml.
 
 Thanks in advance,
 Jan
 
 
 --
 To unsubscribe, e-mail:  
 mailto:tomcat-user-unsubscribe;jakarta.apache.org
 For additional commands, e-mail:
 mailto:tomcat-user-help;jakarta.apache.org
 


__
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/

--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org




Re: JSP error handling

2002-11-06 Thread Kris Schneider
If the errorPage attribute references another JSP, make sure that page has:

%@ page isErrorPage=true %

Otherwise, attempting to use the implicit exception object *should* result in 
an error.

I'm guessing that the javax.servlet.error.* request attributes will only get 
populated if you make use of web.xml error pages. In other words, no errorPage 
attribute in the page directive but an error-page entry in web.xml for the 
appropriate exception type.

Quoting Ricardo Moral [EMAIL PROTECTED]:

 There are two valves used to handle errors. The first
 one is the ErrorDispatcherValve. This is the valve
 that will forward the request to the error page if
 there is a uncaught exception. The second valve is the
 ErrorReportValve wich is the last valve on the list of
 valves of a Host and is used to generate a error
 report in HTML. 
 
 You don't need to add this valves by hand because they
 are added by the start method of the StandardHost
 implementation. If you are using other implementation
 of the Host interface you must add this valves
 yourself.
 
 The exception of JSP's are stored under the attibute
 'javax.servlet.jsp.jspException' of the request. But
 you must access this value directly using the
 'exception' variable already declared on the context
 of the error page.
 
 
 --- Jan Kunzmann [EMAIL PROTECTED] wrote:
  Hi there,
  
  I've a problem with JSP error handling.
  
  I tried to make custom error pages with the
  % page errorPage=... % element. If an error
  occurs during the 
  execution of my jsp page, the error page is called,
  but the 
  javax.servlet.error.* attributes do not contain any
  values.
  
  I looked into the Tomcat 4.0 source and found a
  valve called 
  ErrorDispatcherValve. Has it something to do with
  jsp error handling? I 
  tried to include the valve with Valve... and with
  Host 
  errorReportingValve=, but the error page still
  reports the attributes 
  to be null.
  
  I use Tomcat 4.0.4 from the Debian distribution with
  marginal chances in 
  server.xml.
  
  Thanks in advance,
  Jan
  
  
  --
  To unsubscribe, e-mail:  
  mailto:tomcat-user-unsubscribe;jakarta.apache.org
  For additional commands, e-mail:
  mailto:tomcat-user-help;jakarta.apache.org
  
 
 
 __
 Do you Yahoo!?
 HotJobs - Search new jobs daily now
 http://hotjobs.yahoo.com/
 
 --
 To unsubscribe, e-mail:  
 mailto:tomcat-user-unsubscribe;jakarta.apache.org
 For additional commands, e-mail:
 mailto:tomcat-user-help;jakarta.apache.org
 


-- 
Kris Schneider mailto:kris;dotech.com
D.O.Tech   http://www.dotech.com/

--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org