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

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/spi 
                        AbstractInvocationContext.java
  Log:
  JBPORTAL-979:
  - Added enforceAbsoluteURL and isURLAbsolute on URLTools.
  - Use URLTool.enforceAbsoluteURL where needed.
  
  Revision  Changes    Path
  1.6       +4 -12     jboss-portal/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractInvocationContext.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: AbstractInvocationContext.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-portal/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractInvocationContext.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- AbstractInvocationContext.java	30 Jul 2006 16:17:10 -0000	1.5
  +++ AbstractInvocationContext.java	12 Aug 2006 18:51:01 -0000	1.6
  @@ -21,6 +21,7 @@
   */
   package org.jboss.portal.portlet.impl.spi;
   
  +import org.jboss.portal.common.util.URLTools;
   import org.jboss.portal.portlet.spi.InvocationContext;
   
   import javax.servlet.http.HttpServletRequest;
  @@ -31,17 +32,11 @@
    * An abstract implementation.
    *
    * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
  - * @version $Revision: 1.5 $
  + * @version $Revision: 1.6 $
    */
   public abstract class AbstractInvocationContext implements InvocationContext
   {
   
  -   /** . */
  -   private static final String HTTP_PREFIX = "http://";
  -
  -   /** . */
  -   private static final String FILE_PREFIX = "/";
  -
      /** Return the client request. */
      public abstract HttpServletRequest getClientRequest();
   
  @@ -51,12 +46,9 @@
      /** Validate the url and then delegate the encoding of the url to the client response. */
      public String encodeURL(String url) throws IllegalArgumentException
      {
  -      if (url.startsWith(HTTP_PREFIX) || url.startsWith(FILE_PREFIX))
  -      {
  +      URLTools.enforceAbsoluteURL(url);
            return getClientResponse().encodeURL(url);
         }
  -      throw new IllegalArgumentException("invalid URL " + url);
  -   }
   
      public void setAttribute(Scope scope, String name, Object value)
      {
  
  
  



More information about the jboss-cvs-commits mailing list