shale-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig McClanahan" <craig...@apache.org>
Subject Re: Problems with shale-core
Date Sun, 03 Sep 2006 23:22:21 GMT
On 9/3/06, Adrian Mitev <amittev@gmail.com> wrote:
>
> By the way when i removed the faces-config file from the
> shale-core.jar to disable the phase listener everything worked with
> the jar, but i need the view controler.


If you use the 1.0.3 release (or a very recent daily biuld), the behavior of
handling exceptions thrown by an action event is now programmable, in
several different ways.

* By default, exceptions thrown from lifecycle callback methods (init,
destroy, etc.),
  or from the action method connected to a command link or command button,
  will still be accumulated.  You can change this by defining a class that
implements
  org.apache.shale.view.ExceptionHandler and storing it in application scope
under
  the key defined by FacesConstants.EXCEPTION_HANDLER (the literal value is
  "org$apache$shale$view$EXCEPTION_HANDLER".

* During a phase listener that is invokved after the Invoke Application
phase (i.e.
  just after your command action has returned a logical outcome), it is
checked
  whether there have been any exceptions accumulated by the default handler
above.
  If so, it can optionally do a RequestDispatcher.forward() call to the
context relative
  path of an error display page for your application.  You can configure
such a path
  in web.xml with a context init parameter like this:

    <context-param>
        <param-name>org.apache.shale.view.EXCEPTION_DISPATCH_PATH
</param-name>
        <param-value>/exception-viewer.faces</param-value>
    </context-param>

  This page will be displayed instead of the one that would normally be
selected by
  your navigation rules.  In addition, it will receive request attributes
containing interesting
  facts about the error that occurred, just like an error page you provide
to your servlet
  container as an exception handler.  The most interesting one is an
attribute named
  "javax.servlet.error.exception", which will receive a Shale
ApplicationException that
  lists all the exceptions that have occurred for this request.

This stuff definitely needs to get into the documentation, but I wanted to
give you an immediate response you could start from.

Craig

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message