You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Mike Engelhart <me...@earthtrip.com> on 2000/01/31 20:31:52 UTC

XSP exception handling

Is there a recommended method of handling exceptions from within XSP's?  I'm
having a nightmare of time testing out code because everytime I get a null
pointer exception thrown during the populateDocument() method, I have to
restart my server because there's no clear way to handle the exception and
clean up resources that are in use.   Anyone know of a clean way to handle
this that doesn't require recompiling the source code?

Thanks,

Mike


Re: XSP exception handling

Posted by Pierpaolo Fumagalli <pi...@apache.org>.
Donald Ball wrote:
> 
> Hmm. I don't want the request forwarded, myself, I just want an XML error
> node generated in the XML document so that my stylesheet can render an
> error in a page-dependent way if it chooses (e.g. 'sorry that password is
> invalid' or 'the system is too busy right now'). Would that accomodate
> your desires as well, or are you trying to do something more subtle?

This is a good thing to keep in mind as a feature for Cocoon 2.0

	Pier

-- 
--------------------------------------------------------------------
-          P              I              E              R          -
stable structure erected over water to allow the docking of seacraft
<ma...@betaversion.org>    <http://www.betaversion.org/~pier/>
--------------------------------------------------------------------
- ApacheCON Y2K: Come to the official Apache developers conference -
-------------------- <http://www.apachecon.com> --------------------

Re: XSP exception handling

Posted by Mike Engelhart <me...@earthtrip.com>.
Donald Ball wrote:

> Hmm. I don't want the request forwarded, myself, I just want an XML error
> node generated in the XML document so that my stylesheet can render an
> error in a page-dependent way if it chooses (e.g. 'sorry that password is
> invalid' or 'the system is too busy right now'). Would that accomodate
> your desires as well, or are you trying to do something more subtle?
> 
> - donald
Actually, that's exactly what i want.  JSP still seeps into my thought
process when trying to solve problems.

Mike


Re: XSP exception handling

Posted by Donald Ball <ba...@webslingerZ.com>.
On Mon, 31 Jan 2000, Mike Engelhart wrote:

> Donald Ball wrote:
> 
> > I'm interested in something along these lines as well. Currently, I wrap
> > my library method calls with a big try/catch block and dump the stack
> > trace to System.err. What I'd ideally like to be able to do is either
> > display the error using the standard cocoon frontend, send a 500 error, or
> > create an error XML node in the result document, configurable on a
> > per-file or per-directory basis.
> > 
> > - donald
> Yeah, I'd like to be able to forward the request onto a error.xsp file or
> something like that lets you generate  a page using xsl templates depending
> on the error.

Hmm. I don't want the request forwarded, myself, I just want an XML error
node generated in the XML document so that my stylesheet can render an
error in a page-dependent way if it chooses (e.g. 'sorry that password is
invalid' or 'the system is too busy right now'). Would that accomodate
your desires as well, or are you trying to do something more subtle?

- donald


Re: XSP exception handling

Posted by Mike Engelhart <me...@earthtrip.com>.
Donald Ball wrote:

> I'm interested in something along these lines as well. Currently, I wrap
> my library method calls with a big try/catch block and dump the stack
> trace to System.err. What I'd ideally like to be able to do is either
> display the error using the standard cocoon frontend, send a 500 error, or
> create an error XML node in the result document, configurable on a
> per-file or per-directory basis.
> 
> - donald
Yeah, I'd like to be able to forward the request onto a error.xsp file or
something like that lets you generate  a page using xsl templates depending
on the error.

MIke


Re: XSP exception handling

Posted by Donald Ball <ba...@webslingerZ.com>.
On Mon, 31 Jan 2000, Mike Engelhart wrote:

> Is there a recommended method of handling exceptions from within XSP's?  I'm
> having a nightmare of time testing out code because everytime I get a null
> pointer exception thrown during the populateDocument() method, I have to
> restart my server because there's no clear way to handle the exception and
> clean up resources that are in use.   Anyone know of a clean way to handle
> this that doesn't require recompiling the source code?

I'm interested in something along these lines as well. Currently, I wrap
my library method calls with a big try/catch block and dump the stack
trace to System.err. What I'd ideally like to be able to do is either
display the error using the standard cocoon frontend, send a 500 error, or
create an error XML node in the result document, configurable on a
per-file or per-directory basis.

- donald