org.apache.lenya.util
Class ServletHelper

java.lang.Object
  extended by org.apache.lenya.util.ServletHelper

public final class ServletHelper
extends java.lang.Object

Servlet utility class.


Method Summary
static java.util.Map getParameterMap(org.apache.cocoon.environment.Request request)
          Converts the request parameters to a map.
static java.lang.String getWebappURI(org.apache.cocoon.environment.Request request)
          Returns the URL inside the web application (without the context prefix).
static java.lang.String getWebappURI(java.lang.String context, java.lang.String requestUri)
          Returns the URL inside the web application (without the context prefix).
static boolean isUploadEnabled(org.apache.avalon.framework.service.ServiceManager manager)
          Returns the value of enable-uploads in web.xml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getWebappURI

public static java.lang.String getWebappURI(org.apache.cocoon.environment.Request request)
Returns the URL inside the web application (without the context prefix).

Parameters:
request - The request.
Returns:
A string.

getWebappURI

public static java.lang.String getWebappURI(java.lang.String context,
                                            java.lang.String requestUri)
Returns the URL inside the web application (without the context prefix).

Parameters:
context - The context prefix.
requestUri - The complete request URI.
Returns:
A string.

getParameterMap

public static java.util.Map getParameterMap(org.apache.cocoon.environment.Request request)
Converts the request parameters to a map. If a key is mapped to multiple parameters, a string array is used as the value.

Parameters:
request - The request.
Returns:
A map.

isUploadEnabled

public static boolean isUploadEnabled(org.apache.avalon.framework.service.ServiceManager manager)
                               throws org.apache.excalibur.source.SourceNotFoundException,
                                      org.apache.avalon.framework.service.ServiceException,
                                      javax.xml.parsers.ParserConfigurationException,
                                      org.xml.sax.SAXException,
                                      java.io.IOException,
                                      javax.xml.transform.TransformerException
Returns the value of enable-uploads in web.xml

Parameters:
manager - The Service Manager.
Returns:
true if enable upload is true or not set in web.xml, else false
Throws:
org.apache.excalibur.source.SourceNotFoundException
org.apache.avalon.framework.service.ServiceException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
javax.xml.transform.TransformerException


Copyright 1999-2006 Apache Software Foundation. All Rights Reserved.