org.apache.taglibs.xtags.util
Class URLHelper

java.lang.Object
  extended by org.apache.taglibs.xtags.util.URLHelper

public class URLHelper
extends java.lang.Object

Some helper methods for creating URLs that can handle relative or absolute URIs or full URLs.

Version:
$Revision$
Author:
James Strachan

Constructor Summary
URLHelper()
           
 
Method Summary
static java.net.URL createURL(java.lang.String uri, javax.servlet.jsp.PageContext pageContext)
           
static java.net.URL getResourceURL(java.lang.String uri, javax.servlet.jsp.PageContext pageContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLHelper

public URLHelper()
Method Detail

createURL

public static java.net.URL createURL(java.lang.String uri,
                                     javax.servlet.jsp.PageContext pageContext)
                              throws java.net.MalformedURLException
Returns:
the URL for the given URI. If the uri contains a ':' then it is assumed to be a URL, otherwise a local URI resource is used.
Throws:
java.net.MalformedURLException

getResourceURL

public static java.net.URL getResourceURL(java.lang.String uri,
                                          javax.servlet.jsp.PageContext pageContext)
                                   throws java.net.MalformedURLException
Returns:
the URL object for the given resource URI using the ServletContext.getResource(String) method. If the path does not start with a '/' character then a relative URI is calculated.
Throws:
java.net.MalformedURLException


Copyright ? 2000-2004 The Apache Software Foundation. All Rights Reserved.