You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Raymond <pp...@hotmail.com> on 2005/05/17 12:09:46 UTC

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()) {
   return;
  } 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

message

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

exception

javax.servlet.ServletException
 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: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org