portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets RedirectPortlet.java
Date Thu, 11 Mar 2004 01:04:28 GMT
taylor      2004/03/10 17:04:28

  Modified:    src/java/org/apache/jetspeed/portal/portlets
                        RedirectPortlet.java
  Log:
  Fixed redirect portlet from getting intermittent illegal state errors
  Javascript solution provided by Jeremy Ford over Jetspeed IRC ;)
  
  Revision  Changes    Path
  1.3       +7 -4      jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/RedirectPortlet.java
  
  Index: RedirectPortlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/RedirectPortlet.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RedirectPortlet.java	23 Feb 2004 04:03:34 -0000	1.2
  +++ RedirectPortlet.java	11 Mar 2004 01:04:28 -0000	1.3
  @@ -68,15 +68,18 @@
           }
                        
           String url = this.getPortletConfig().getInitParameter("url");
  -        rundata.setRedirectURI(url);
  +        // rundata.setRedirectURI(url);
           HttpServletRequest request = rundata.getRequest();
           HttpServletResponse response = rundata.getResponse();
           try
           {
  -            response.sendRedirect(url);
  +            String script = "<script> setTimeout( \"location.href='" + url + "'\",
1) </script>";
  +            response.getWriter().write(script);
  +            // response.sendRedirect(url);
           }
  -        catch (IOException e)
  +        catch (Exception e)
           {
  +            e.printStackTrace();
               String message = "Failed to redirect to " + url;
               logger.error(message, e);
               return new JetspeedClearElement(message);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message