[jboss-cvs] jboss-seam/src/main/org/jboss/seam/exceptions ...

Gavin King gavin.king at jboss.com
Sun Feb 4 04:41:18 EST 2007


  User: gavin   
  Date: 07/02/04 04:41:18

  Modified:    src/main/org/jboss/seam/exceptions  RedirectHandler.java
  Log:
  fix <redirect/> w/o an explicit viewid
  
  Revision  Changes    Path
  1.5       +9 -0      jboss-seam/src/main/org/jboss/seam/exceptions/RedirectHandler.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: RedirectHandler.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/exceptions/RedirectHandler.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- RedirectHandler.java	4 Feb 2007 05:41:58 -0000	1.4
  +++ RedirectHandler.java	4 Feb 2007 09:41:17 -0000	1.5
  @@ -1,7 +1,11 @@
   package org.jboss.seam.exceptions;
   
  +import javax.faces.context.FacesContext;
  +import javax.servlet.http.HttpServletRequest;
  +
   import org.jboss.seam.contexts.Contexts;
   import org.jboss.seam.core.Conversation;
  +import org.jboss.seam.core.Pages;
   import org.jboss.seam.core.RedirectException;
   import org.jboss.seam.log.LogProvider;
   import org.jboss.seam.log.Logging;
  @@ -17,6 +21,11 @@
      public void handle(Exception e) throws Exception
      {
         String viewId = getViewId(e);
  +      if (viewId==null)
  +      {
  +         String servletPath = ( (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest() ).getServletPath();
  +         viewId = servletPath.substring(0, servletPath.lastIndexOf('.')) + Pages.getSuffix();
  +      }
         
         if (log.isDebugEnabled())
         {
  
  
  



More information about the jboss-cvs-commits mailing list