override Exception

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

override Exception

I tried to override the Exception page like this without success:
    if debug_mode (a session property stored in Visit) then show the
original Tapestry Exception page, else redirect to Home

I wrote something like this:

public abstract class Exception extends org.apache.tapestry.pages.Exception
implements PageRenderListener {

 public abstract Throwable getException();
 public abstract void setException(Throwable cause);

 public void pageBeginRender(PageEvent event) {
  Visit visit = (Visit)getVisit();
  IRequestCycle cycle = getRequestCycle();
  if (visit.isDebugMode()) {
  } else {
   throw new PageRedirectException("Home");

What's wrong with it?

When it's debugMode, the application shows a blank page (isn't it supposed
to automatically call the superclass' logic?)

When it's not debugMode, it returns this HTTP 500 Error

HTTP Status 500

type Exception report


description The server encountered an internal error () that prevented it
from fulfilling this request.


 org.apache.tapestry.engine.AbstractEngine.activateExceptionPage(AbstractEngine.java:480) org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:914) org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:197) org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:158) javax.servlet.http.HttpServlet.service(HttpServlet.java:689) javax.servlet.http.HttpServlet.service(HttpServlet.java:802)root causeorg.apache.tapestry.RedirectException...Thank you very much for help.Regards,Raymond

To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]