[jboss-cvs] jboss-portal/portlet/src/main/org/jboss/portal/portlet/impl/jsr168 ...

Chris Laprun chris.laprun at jboss.com
Sat Aug 12 14:51:01 EDT 2006


  User: claprun 
  Date: 06/08/12 14:51:01

  Modified:    portlet/src/main/org/jboss/portal/portlet/impl/jsr168 
                        ActionResponseImpl.java
  Log:
  JBPORTAL-979:
  - Added enforceAbsoluteURL and isURLAbsolute on URLTools.
  - Use URLTool.enforceAbsoluteURL where needed.
  
  Revision  Changes    Path
  1.12      +7 -9      jboss-portal/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/ActionResponseImpl.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ActionResponseImpl.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-portal/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/ActionResponseImpl.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- ActionResponseImpl.java	12 Aug 2006 12:46:20 -0000	1.11
  +++ ActionResponseImpl.java	12 Aug 2006 18:51:01 -0000	1.12
  @@ -23,13 +23,14 @@
   
   import org.apache.log4j.Logger;
   import org.jboss.portal.Mode;
  +import org.jboss.portal.common.util.URLTools;
  +import org.jboss.portal.portlet.ParametersStateString;
   import org.jboss.portal.portlet.Properties;
   import org.jboss.portal.portlet.invocation.ActionInvocation;
   import org.jboss.portal.portlet.result.HTTPRedirectionResult;
  +import org.jboss.portal.portlet.result.RedirectionResult;
   import org.jboss.portal.portlet.result.RenderResult;
   import org.jboss.portal.portlet.result.Result;
  -import org.jboss.portal.portlet.result.RedirectionResult;
  -import org.jboss.portal.portlet.ParametersStateString;
   
   import javax.portlet.ActionResponse;
   import javax.portlet.PortletMode;
  @@ -41,7 +42,7 @@
   
   /**
    * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
  - * @version $Revision: 1.11 $
  + * @version $Revision: 1.12 $
    */
   public class ActionResponseImpl extends PortletResponseImpl implements ActionResponse
   {
  @@ -125,10 +126,7 @@
            // do something more clever than simply returning
            return;
         }
  -      if (!location.startsWith("http://") && !location.startsWith("/") && !location.startsWith("https://"))
  -      {
  -         throw new IllegalArgumentException("No relative urls are accepted");
  -      }
  +      URLTools.enforceAbsoluteURL(location);
         sendRedirect(new HTTPRedirectionResult(location));
      }
   
  
  
  



More information about the jboss-cvs-commits mailing list