atg.servlet
Class ServletUtil

java.lang.Object
  extended by atg.servlet.ServletUtil

public class ServletUtil
extends java.lang.Object

This class file implements some static utilities that are useful wrappers for those implementing servlets.


Field Summary
static java.lang.String APPSERVER_CONFIG_NUCLEUS_PATH
           
static java.lang.String APPSERVER_NAME
           
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String CONTEXT_PATHS
           
static java.lang.String DAF_DROPLET_EVENT_SERVLET_NAME
           
static java.lang.String DEFAULT_CHARACTER_ENCODING
          Default character encoding per SRV.4.9
static java.lang.String DROPLET_EVENT_SERVLET_NAME
           
static java.lang.String DYNAMO_INITIAL_CONTEXT_POOL_PATH
           
static java.lang.String DYNAMO_SESSION_MANAGER_PATH
           
static ParameterName FORM_NAME
           
static java.lang.String GENERIC_SESSION_MANAGER_PATH
           
static java.lang.String HOST_SERVLET_CONTEXT_ATTR
           
static java.lang.String IBM_MANAGED_SERVER_CLASS
           
static ParameterName IMPORTS_NAME
           
static java.lang.String JNDI_PATH_PROFILE
          The JNDI path of the current profile for DAS.
static java.lang.String JNDI_PATH_REQUEST
          The JNDI path of the request for DAS.
static java.lang.String JNDI_PATH_RESPONSE
          The JNDI path of the response for DAS.
static java.lang.String JOB_REGISTRY_PATH
           
static ParameterName LOCALE_PARAM
          Request parameter that identifies the desired locale for user messages.
static boolean mLoggingDebug
           
static boolean mLoggingError
           
static java.lang.String NO_FLUSH_RESPONSE_CONTEXT_ATTR
          Attribute where we stash our NoFlushHttpServletResponse during a DSP PageTag.
static java.lang.String PAGE_FILTER_CHAIN_ATTRIBUTE
           
static java.lang.String PAGE_FILTER_ENABLED
           
static java.lang.String POST_FORWARD_URI_ATTR
           
static java.lang.String POST_REQUEST_JOB_IDS
           
static java.lang.String POST_REQUEST_PROCESSOR_OWNER
           
static java.lang.String POST_REQUEST_PROCESSORS_NAME
           
static java.lang.String PRE_FORWARD_CONTEXT_PATH_ATTR
           
static java.lang.String PRE_FORWARD_URI_ATTR
           
static java.lang.String PRE_FORWARD_URI_WITH_QUERY_STRING_ATTR
           
static boolean sDynamoAppServer
           
static boolean sDynamoAppServerSet
           
static java.lang.String SESSION_NAME_CONTEXT_NAME
           
static java.lang.String SESSION_NEEDS_RESTORE
           
static java.lang.String SESSION_RESTORED_MARKER
           
static atg.servlet.JobRegistry sJobRegistry
           
static javax.naming.InitialContext sWorkingInitialContext
          Returns the UserTransaction object for use by dynamo applications.
static java.lang.String USE_XML_PARAM_DELIMITER
          This can be set from the dsp:page and the dsp:isxml tags.
static java.lang.String WINDOW_SESSION_NAME
           
 
Constructor Summary
ServletUtil()
           
 
Method Summary
static void addPostRequestProcessor(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse, atg.servlet.PostRequestProcessor pProcessor, java.lang.String pOwnerName)
          Pipeline servlets that require actions to be performed after the completion of the request (usually to clean up some action performed before calling "passRequest") should not directly perform those actions after calling passRequest.
static void callServlet(javax.servlet.Servlet pServlet, java.lang.String pName, javax.servlet.ServletRequest pReq, javax.servlet.ServletResponse pRes)
          Just invokes the servlet right now.
static void checkInTag(atg.servlet.pagecompile.taglib.TagWrapper[] pWrappers, int pIndex)
          Check in the tag at pIndex of pWrappers.
static boolean checkIsSingleByteEncoding(java.lang.String pEncoding)
          Returns false if the provided character encoding requires a reader/writer, true if it doesn't.
static boolean checkIsSingleByteEncodingIgnoringCase(java.lang.String pEncoding)
          Returns false if the provided character encoding requires a reader/writer, true if it doesn't.
static boolean checkIsValidCharacterEncoding(java.lang.String pEncoding)
          Determines whether the provided encoding is a valid and supported by the current VM.
static javax.servlet.jsp.tagext.Tag checkOutInitTag(atg.servlet.pagecompile.taglib.TagManager pTagManager, atg.servlet.pagecompile.taglib.TagWrapper[] pWrappers, int pIndex, java.lang.String pAttSet, javax.servlet.jsp.PageContext pPageContext, javax.servlet.jsp.tagext.Tag pParentTag)
          Check out a TagWrapper from pTagManager, and set the pIndex element of the pWrappers array to the checked out TagWrapper.
 javax.servlet.jsp.tagext.Tag checkOutTag(atg.servlet.pagecompile.taglib.TagManager pTagManager, atg.servlet.pagecompile.taglib.TagWrapper[] pWrappers, int pIndex, java.lang.String pAttSet)
          Check out a TagWrapper from pTagManager, and set the pIndex element of the pWrappers array to the checked out TagWrapper.
static java.lang.Throwable cleanUpTags(javax.servlet.jsp.tagext.Tag[] pTags)
          Run through the pTags array, releasing any tags still in the list.
static java.lang.Throwable cleanUpTags(atg.servlet.pagecompile.taglib.TagWrapper[] pWrappers)
          Run through the pWrappers array, check-in any tags still in the list.
protected static void clearIncludeAttributes(javax.servlet.http.HttpServletRequest pRequest)
          Blindly clear out all the include attributes.
static java.lang.Object convertPropertyValue(java.lang.String pValue, java.lang.Class pClass, NameResolver pContext)
          Converts the specified value to the specified class.
static java.util.Dictionary convertStringToDictionary(DynamoHttpServletRequest pRequest, java.lang.String pValue)
          For a given string value of the form:
static java.lang.String convertToNativeString(java.lang.String pValue, java.lang.String pEncoding)
          This method converts the unicode string supplied to a string encoded in the native encoding supplied.
static java.lang.Object doPropertySetAsText(java.lang.Class pClass, java.lang.String pValue)
          Gets an appropriate PropertyEditor and uses it to convert the specified value to the specified class.
static void embed(java.lang.String pPath, DynamoHttpServletRequest request, javax.servlet.ServletResponse response)
          Embeds an html or jhtml file into the current request.
static void embed(java.lang.String pPath, javax.servlet.Servlet pServlet, DynamoHttpServletRequest request, javax.servlet.ServletResponse response)
          Deprecated.  
static java.lang.String escapeHtmlString(java.lang.String pStr)
          Returns a string that is properly escaped for use either as an HTML attribute value or an HTML content section.
static java.lang.String escapeHtmlString(java.lang.String pStr, boolean pEscapeAmp)
          Returns a string that is properly escaped for use either as an HTML attribute value or an HTML content section.
static java.lang.String escapeURLString(java.lang.String pStr)
          Return the passed in String as a URL encoded String.
static void execCgi(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse, java.lang.String pPath, boolean pIsCgi)
          Executes the CGI command passed in with pPath.
static java.lang.String fileLastMod(DynamoHttpServletRequest pRequest, java.lang.String pDocPath)
          Finds the file on disk and returns it's last modification date/time formatted according to the DATE_FORMAT request attribute.
static java.lang.String fileSize(DynamoHttpServletRequest pRequest, java.lang.String pDocPath)
          Finds the file on disk and returns it's size in bytes in a string formatted according to the SIZE_FORMAT request attribute.
static void flushBeforeInclude(DynamoHttpServletResponse pRes)
          This method should be invoked before an RequestDispatcher.include if one does not have access to PageContext (such as in a servlet).
static void flushBeforeInclude(javax.servlet.jsp.JspWriter pOut)
          If the given JspWriter is a BodyContent this method will call writeOut on that BodyContent and all of its enclosing BodyContents.
Finally when a non BodyContent JspWriter is encountered that JspWriter will be flushed with flush().
static java.lang.String formattedDate(DynamoHttpServletRequest pRequest, long pTimeMillis, java.util.TimeZone pTimeZone)
          Formats the given date according to the timefmt set by the SSI config command.
static atg.service.dynamo.AppServerConfig getAppServerConfig()
           
static java.lang.String[] getCleanClassPathArrayWithLocallib(atg.applauncher.AppLauncher pLauncher)
          Returns classPath with locallib elements without enries that marked as ignored in manifest files (see ATG-Assembler-Class-Path-Ignore manifest attribute).
static java.lang.String getContentCharset(java.lang.String mimeType)
          Returns the content charset with the default if it is not set
static java.lang.String getContentCharset(java.lang.String mimeType, java.lang.String pDefault)
          Returns the content type used for reading this data.
static java.lang.String getCurrentContextPath(javax.servlet.http.HttpServletRequest pRequest)
          Get the current context path...
static java.lang.String getCurrentContextPath(javax.servlet.http.HttpServletRequest pRequest, boolean pInInclude)
          Get the current context path...
static java.lang.String getCurrentPathInfo(javax.servlet.http.HttpServletRequest pRequest)
          Get the current path info...
static java.lang.String getCurrentPathInfo(javax.servlet.http.HttpServletRequest pRequest, boolean pInInclude)
          Get the current path info...
static java.lang.String getCurrentPathTranslated(javax.servlet.http.HttpServletRequest pRequest)
          Get the current path translated...
static java.lang.String getCurrentPathTranslated(javax.servlet.http.HttpServletRequest pRequest, boolean pInInclude)
          Get the current path translated...
static java.lang.String getCurrentQueryString(javax.servlet.http.HttpServletRequest pRequest)
          Get the current query string...
static java.lang.String getCurrentQueryString(javax.servlet.http.HttpServletRequest pRequest, boolean pInInclude)
          Get the current query string...
static DynamoHttpServletRequest getCurrentRequest()
          Returns the request associated with the current thread, null if there is no such request.
static java.lang.String getCurrentRequestURI(javax.servlet.http.HttpServletRequest pRequest)
          Get the current request URI...
static DynamoHttpServletResponse getCurrentResponse()
          Returns the response associated with the current thread, null if there is no such response.
static javax.servlet.ServletContext getCurrentServletContext(javax.servlet.http.HttpServletRequest pRequest)
          Get the current requests ServletContext.
static java.lang.String getCurrentServletContextName(javax.servlet.http.HttpServletRequest pRequest)
          Get the current requests ServletContextName.
static java.lang.String getCurrentServletPath(javax.servlet.http.HttpServletRequest pRequest)
          Get the current serlvet path...
static java.lang.String getCurrentServletPath(javax.servlet.http.HttpServletRequest pRequest, boolean pInInclude)
          Get the current serlvet path...
static RepositoryItem getCurrentUserProfile()
          Returns the profile associated with the current thread, null if there is no such profile.
static DropletEventServlet getDropletEventServlet()
          Returns the DropletEventServlet, extracting it from Dynamo through JNDI.
static DynamoHttpServletRequest getDynamoRequest(javax.servlet.ServletContext pContext, javax.servlet.ServletRequest pRequest, javax.servlet.ServletResponse pResponse)
          Get's the DynamoHttpServletRequest, creating it if necessary.
static DynamoHttpServletRequest getDynamoRequest(javax.servlet.ServletRequest pRequest)
          Retrieves the DynamoHttpServletRequest from the given regular ServletRequest.
static DynamoHttpServletResponse getDynamoResponse(javax.servlet.ServletRequest pRequest, javax.servlet.ServletResponse pResponse)
          Returns the DynamoHttpServletResponse associated with the current request
static javax.servlet.http.HttpSession getGlobalSession(boolean create)
          Get the global, parent session.
static java.lang.String getHostHeader(javax.servlet.http.HttpServletRequest pRequest)
          Return the host header.
static java.lang.String getJBoss5JspClasspath(javax.servlet.ServletContext sc)
          Returns JBoss5 class path
static java.lang.String getJBoss5PageCompileClasspath()
          Returns JBoss5 page compile class path
static java.lang.String getJBossJspClasspath()
           
static java.lang.String getJBossJspClasspath(javax.servlet.ServletContext sc)
           
static java.lang.String getJspClasspath(javax.servlet.ServletContext pContext)
          If we are on a 3PAS returns the classpath used by that appserver for compiling jsp pages.
static java.lang.String getLiteralCurrentPathTranslated(javax.servlet.http.HttpServletRequest pRequest, boolean pInInclude)
          Get the current path translated...
static javax.servlet.RequestDispatcher getLocalRequestDispatcher(javax.servlet.http.HttpServletRequest pRequest, java.lang.String pPath)
          Returns a request dispatcher for pPath in the curent web-app.
static java.lang.String getNewBaseDirectory(DynamoHttpServletRequest pRequest, javax.servlet.ServletContext pServletContext, java.lang.String pNewURI)
          Return the new directory for the specified URL, if it differs from the current base directory.
static java.lang.String getParamDelimiter(DynamoHttpServletRequest pReq)
          Returns the Parameter Delimiter for a request.
static java.lang.String getParentSessionId(javax.servlet.http.HttpServletRequest pRequest)
          Returns the parent session id.
static java.lang.String getParentSessionIdFromAttribute(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpSession pSession)
          Return the parent session id of the session by fetching from the holder contains in the PARENT_SESSION_ID_ATTR session attribute.
static java.lang.String getParentSessionIdFromAttribute(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpSession pSession, boolean pCopyToRequest)
          Return the parent session id of the session by fetching from the holder contains in the PARENT_SESSION_ID_ATTR session attribute.
static java.lang.String getParentSessionIdFromAttribute(javax.servlet.http.HttpSession pSession)
          Return the parent session id of the session by fetching from the holder contains in the PARENT_SESSION_ID_ATTR session attribute.
static java.lang.Object getPropertyValue(DynamoHttpServletRequest pRequest, java.lang.String pPropertyPath)
          Returns the object property value for the specified component and the specified path.
static java.lang.Object getPropertyValue(javax.servlet.ServletRequest pRequest, java.lang.String pPropertyPath)
          Returns the object property value for the specified component and the specified path.
static javax.servlet.RequestDispatcher getRequestDispatcher(javax.servlet.http.HttpServletRequest pRequest, java.lang.String pContextPath, java.lang.String pPath)
          Returns a request dispatcher for pPath in the curent web-app.
static java.lang.String getRequestURI(DynamoHttpServletRequest pRequest, java.lang.String pURL)
          Get the requestURI that will be returned when the server requests the URL.
static java.lang.String getRequestURI(DynamoHttpServletRequest pRequest, java.lang.String pURL, boolean pStripQueryParams)
          Get the requestURI that will be returned when the server requests the URL
static java.lang.String getRequestURI(javax.servlet.http.HttpServletRequest pRequest, java.lang.String pURL)
          Get the requestURI that will be returned when the server requests the URL.
static java.lang.String getRequestURI(javax.servlet.http.HttpServletRequest pRequest, java.lang.String pURL, boolean pStripQueryParams)
          Get the requestURI that will be returned when the server requests the URL
static java.lang.String getRequestURI(javax.servlet.ServletRequest pReq)
          Return the Dynamo specific ReuestURI, this can be different from pReq.getRequestURI() in the case of running with a different app server.
static java.lang.String getRequestURIFromPathInfo(javax.servlet.http.HttpServletRequest pRequest, java.lang.String pPath)
          Returns the given path prepended with the contextPath and servletPath (if they are set)
static java.lang.String getRequestURL(javax.servlet.http.HttpServletRequest pRequest, java.lang.String pURI)
          Given a potentially relative URL of the form "/xxx" or "../xxx", this returns the absolute URL you'd use to request this page (i.e.
static atg.servlet.sessiontracking.DynamoSessionManager getSessionManager()
          Returns the session manager for the current installation.
In DAF this returns a GenericSessionManager in Dynamo it returns a SessionManager
static NameContext getSessionNameContext(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpSession pSession, Nucleus pNucleus)
          Returns the NameContext associated with a given session.
static java.lang.String getStackTrace(java.lang.Throwable pThrowable)
          Returns the stack trace of an exception as a string.
static atg.servlet.pagecompile.taglib.TagManager getTagManager(DynamoHttpServletRequest pRequest, java.lang.String pTagLibURI, java.lang.String pTagName, int pLineNumber)
           
static atg.servlet.pagecompile.taglib.TagManager getTagManager(DynamoHttpServletRequest pRequest, java.lang.String pTagLibURI, java.lang.String pResovledTagLibURI, java.lang.String pTagName, int pLineNumber)
           
static boolean getUseExternalTransactionManager()
          Returns the true if we are using the external app server Transaction Manager
static java.util.Locale getUserLocale()
          Returns the locale to use when looking up localized messages that will be shown to the user.
static java.util.Locale getUserLocale(DynamoHttpServletRequest pRequest)
          Returns the locale to use when looking up localized messages that will be shown to the user.
static java.util.Locale getUserLocale(DynamoHttpServletRequest pRequest, boolean pUseRequestLocale)
          Returns the locale to use when looking up localized messages that will be shown to the user.
static javax.transaction.UserTransaction getUserTransaction()
           
static java.lang.String getUserTransactionURL()
          Returns the URL used to retrieve UserTransaction objects.
static java.lang.String getWeblogicJspClasspath()
           
static java.lang.String getWebSphereJspClasspath()
           
static java.lang.String getWebsphereServerName()
          Returns the name of the Websphere AE server this method was invoked in.
Returns null if the name cannot be determined, or if the current application server is not Websphere AE.
static atg.nucleus.WindowScopeSession getWindowSession()
           
static void handleJspTagIOException(java.io.IOException pException)
          Utility method to attempt to "do the right thing" when encountering an IOException inside a JSP Tag, whose methods cannot throw IOException, so much throw some kind of JspException.
static void handleJspTagIOException(java.lang.String pMessage, java.io.IOException pException)
          Utility method to attempt to "do the right thing" when encountering an IOException inside a JSP Tag, whose methods cannot throw IOException, so much throw some kind of JspException.
static boolean inInclude(javax.servlet.ServletRequest pRequest)
          Whether we are current within a RequestDispatcher.include()
static javax.servlet.jsp.tagext.Tag initTag(javax.servlet.jsp.tagext.Tag pTag, javax.servlet.jsp.tagext.Tag[] pTags, int pIndex, javax.servlet.jsp.PageContext pPageContext, javax.servlet.jsp.tagext.Tag pParentTag)
          Initialize pTag by setting the pageContext and parentTag.
static void invalidateSession(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpSession pSession)
          On DAF this method makes sure that the "parent" session gets invalided when you attempt to invalide a child session.
static void invalidateSession(javax.servlet.http.HttpSession pSession)
          Deprecated. 
static void invalidateSessionNameContext(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpSession pSession)
          Flags the main SessionNameContext as invalid.
static void invalidateSessionNameContext(javax.servlet.http.HttpSession pSession)
          Deprecated. 
static void invokeInclude(javax.servlet.RequestDispatcher pDispatcher, javax.servlet.ServletRequest pRequest, javax.servlet.ServletResponse pResponse)
          Invoke an include, and restore the state of the dynamo request and respose pointers afterwards.
static void invokeNoFlushInclude(javax.servlet.RequestDispatcher pDispatcher, javax.servlet.ServletRequest pRequest, javax.servlet.ServletResponse pResponse)
          Invoke an include which attempts NOT to flush.
static boolean isDynamoJ2EEServer()
          This method can be used to determine whether or not you are running on a dynamo J2EE server.
static boolean isEquivalentCharset(java.lang.String pOldCharset, java.lang.String pNewCharset)
          Returns true if the two charsets are *effectively* equivalent.
static boolean isGenericJ2EEServer()
          Return true if we are running on a Tomcat servlet container.
static boolean isJBoss()
          Return true if we are running on a Tomcat servlet container.
static boolean isJBoss5()
           
static boolean isPageFilterEnabled(DynamoHttpServletRequest pRequest)
          Returns true if DAF requests are being handled by a servlet 2.3 filter and funneled through the dafpipline.
static boolean isUsingURLRewriting(javax.servlet.http.HttpServletRequest pRequest)
          This method returns true if this request is using URL rewriting.
static boolean isWebLogic()
          Return true if we are running on WebLogic.
static boolean isWebSphere()
          Return true if we are running on WebSphere.
static javax.servlet.Servlet loadServlet(DynamoHttpServletRequest pRequest, java.lang.String pName, java.lang.String pCode, java.lang.String pCodeBase, java.util.Properties pArgs)
          Loads the servlet with the specified, name, code, codebase and arguments.
static java.lang.Object lookupInInitialContext(java.lang.String pName)
          Do a lookup using a generic InitialContext...
static java.lang.String makeURIAbsolute(java.lang.String pLocation, DynamoHttpServletRequest pRequest)
          Make a relative path an absolute URI (no host or protocol).
static java.lang.String makeURIAbsolute(java.lang.String pLocation, javax.servlet.http.HttpServletRequest pRequest, int pEncodeContextPathMode, boolean pEncodeServletPath)
          Make a relative path an absolute URI (no host or protocol).
static java.lang.String makeURIAbsoluteURL(java.lang.String pLocation, DynamoHttpServletRequest pRequest)
          Make a relative path an absolute URI (no host or protocol).
static java.lang.String makeURIAbsoluteURL(java.lang.String pLocation, javax.servlet.http.HttpServletRequest pRequest, int pEncodeContextPathMode, boolean pEncodeServletPath)
          Make a relative path an absolute URI (no host or protocol).
static javax.servlet.jsp.JspWriter popBody(javax.servlet.jsp.PageContext pPageContext, boolean[] pBodyContentsPushed, int pIndex)
          Do a popBody, and record at pIndex of pBodyContentsPushed that that body was popped.
static javax.servlet.jsp.JspWriter popBodyContents(javax.servlet.jsp.PageContext pPageContext, javax.servlet.jsp.JspWriter pOut, boolean[] pBodyContentsPushed)
          Run through the pBodyContentsPushed boolean array, and pop any body contents that are marked as pushed.
static javax.servlet.jsp.JspWriter popBodyContents(javax.servlet.jsp.PageContext pPageContext, javax.servlet.jsp.JspWriter pOut, boolean[] pBodyContentsPushed, int pFromIndex, int pToIndex)
          Run through a specific range of the the pBodyContentsPushed boolean array, and pop any body contents that are marked as pushed.
static java.lang.String prependSchemeAndHost(javax.servlet.http.HttpServletRequest pRequest, java.lang.String pURI)
          Prepend the scheme and the host (and possibly port) as appropriate.
static java.lang.String prependSchemeAndHost(java.lang.String pScheme, java.lang.String pHost, int pPort, java.lang.String pURI)
          Prepend the scheme and the host (and possibly port) as appropriate.
static void printStackTrace(java.lang.Throwable pThrowable, javax.servlet.ServletOutputStream pOut)
          Prints the stack trace of an exception with the given ServletOutputStream.
static void processPostRequestProcessors(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Executes the post request processors.
static java.lang.String processRedirectURL(java.lang.String pPath, DynamoHttpServletRequest pRequest, boolean pEncodeSessionId)
          Handles the path processing required of Servlet 2.3's rendition of sendRedirect().
static javax.servlet.jsp.JspWriter pushBody(javax.servlet.jsp.PageContext pPageContext, boolean[] pBodyContentsPushed, int pIndex)
          Do a pushBody, and record at pIndex of pBodyContentsPushed that that body was pushed.
static atg.servlet.RequestStateRestorer recordAndClearIncludeAttributes(javax.servlet.http.HttpServletRequest pRequest)
          Record and clear (if needed) any servlet include attributes on the request.
static void releaseTag(javax.servlet.jsp.tagext.Tag[] pTags, int pIndex)
          Call release on the tag at pIndex of pTags.
static java.lang.String resolvePathFromRelativeURL(java.lang.String pRelativeURL, java.lang.String pFilePath)
          Takes a relative URL (i.e.
static java.lang.String resolveTranslatedPathFromURI(java.lang.String pPath, DynamoHttpServletRequest pRequest)
          Takes a URI and a request it is associated with.
static void serviceWithoutIncludeAttributes(javax.servlet.Servlet pServlet, DynamoHttpServletRequest pRequest, javax.servlet.ServletResponse pResponse, boolean pIsDynamoResponseAndServlet)
          Invoke service ont he specified servlet without any include attributes...
static DynamoHttpServletRequest setCurrentRequest(DynamoHttpServletRequest pRequest)
          Sets the current response object associated with this request.
static DynamoHttpServletResponse setCurrentResponse(DynamoHttpServletResponse pResponse)
          Sets the current response object associated with this request.
static RepositoryItem setCurrentUserProfile(RepositoryItem pItem)
          Sets the current user profile
static void setDateFormat(DynamoHttpServletRequest pRequest, java.lang.String pSsiFormatStr)
          Sets the pagecompile date format attribute on the request.
static void setDynamicContentHeaders(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method calls setNoCacheHeaders on pResponse if it determines that pRequest comes from a proxy server, or a user-agent that is known to be a bad-cacher (i.e.
static void setEndRequestThreadPriority()
          Called at the end of the request.
static void setInitProperties(javax.servlet.Servlet pServlet, javax.servlet.ServletConfig pConfig, NameResolver pContext)
           
static void setIsDynamoAppserver(boolean pDynamoAppServer)
          Deprecated.  
static void setIsJBoss5(boolean pIsJboss5)
           
static void setJBoss5PageCompileClasspath(javax.servlet.ServletContext sc, atg.applauncher.AppLauncher pLauncher)
          Set JBoss5 page compile class path
static void setNoCacheHeaders(DynamoHttpServletResponse pResponse)
          This method sets the HTTP headers Pragma: no-cache, and Expires: in an attempt to prevent a browser or proxy from caching a response.
static void setNoCacheHeaders(javax.servlet.http.HttpServletResponse pResponse)
          This method sets the HTTP headers Pragma: no-cache, and Expires: in an attempt to prevent a browser or proxy from caching a response.
static void setParentSessionIdAttribute(javax.servlet.http.HttpSession pSession, java.lang.String pParentSessionId)
          Set the parent session id attribute to hold the specified parent session id.
static void setParentSessionIdRequestAttribute(javax.servlet.http.HttpServletRequest pRequest, java.lang.String pParentSessionId)
          Set the parent session id request attribute to hold the specified parent session id.
static boolean setPropertyValue(DynamoHttpServletRequest pReq, DynamoHttpServletResponse pRes, java.lang.String pPropertyPath, java.lang.Object pValue)
          This method sets the property value specified by the pPropertyPath parameter to the value specified by the pValue parameter.
static boolean setPropertyValue(javax.servlet.ServletRequest pReq, javax.servlet.ServletResponse pRes, java.lang.String pPropertyPath, java.lang.Object pValue)
          This method sets the property value specified by the pPropertyPath parameter to the value specified by the pValue parameter.
static void setStartRequestThreadPriority()
          Attempts to keep request handling thread priority higher while it's actually serving a page.
static void setUseExternalTransactionManager(boolean pUseExternalTransactionManager)
          Sets the flag to indicate if we are to use the external app servers transaction manager to avoid starting dynamo's transaction manager
static void setUserTransactionURL(java.lang.String pURL)
          Sets the JNDI URL for use in retrieving the UserTransaction object.
static java.lang.String toString(boolean b)
           
static java.lang.String toString(char c)
           
static java.lang.String toString(char[] data)
           
static java.lang.String toString(double d)
           
static java.lang.String toString(float f)
           
static java.lang.String toString(int i)
           
static java.lang.String toString(long l)
           
static java.lang.String toString(java.lang.Object obj)
          Returns the specified value as a string like String.valueOf, except if the value is null, an empty string is returned instead.
static void updateRequestResponse(javax.servlet.ServletRequest pRequest, javax.servlet.ServletResponse pResponse)
          Makes sure that the underlying request/response of the current dynamo request/response matches that of the current request.
static java.lang.Object valuesForMultiValuedHeader(java.lang.String pHeaderName, java.lang.String pHeaderValue, java.util.Vector pDest)
           
static boolean valuesMatch(java.lang.Object pValue1, java.lang.Object pValue2)
          This returns true if the first argument matches the second argument.
static boolean valuesMatchIgnoreCase(java.lang.Object pValue1, java.lang.Object pValue2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


JNDI_PATH_REQUEST

public static java.lang.String JNDI_PATH_REQUEST
The JNDI path of the request for DAS. Does not work on modern application servers.


JNDI_PATH_RESPONSE

public static java.lang.String JNDI_PATH_RESPONSE
The JNDI path of the response for DAS. Does not work on modern application servers.


JNDI_PATH_PROFILE

public static java.lang.String JNDI_PATH_PROFILE
The JNDI path of the current profile for DAS. Does not work on modern application servers.


IMPORTS_NAME

public static ParameterName IMPORTS_NAME

FORM_NAME

public static ParameterName FORM_NAME

LOCALE_PARAM

public static final ParameterName LOCALE_PARAM
Request parameter that identifies the desired locale for user messages.


NO_FLUSH_RESPONSE_CONTEXT_ATTR

public static final java.lang.String NO_FLUSH_RESPONSE_CONTEXT_ATTR
Attribute where we stash our NoFlushHttpServletResponse during a DSP PageTag.

See Also:
Constant Field Values

USE_XML_PARAM_DELIMITER

public static final java.lang.String USE_XML_PARAM_DELIMITER
This can be set from the dsp:page and the dsp:isxml tags.

See Also:
Constant Field Values

DEFAULT_CHARACTER_ENCODING

public static final java.lang.String DEFAULT_CHARACTER_ENCODING
Default character encoding per SRV.4.9

See Also:
Constant Field Values

sDynamoAppServer

public static boolean sDynamoAppServer

sDynamoAppServerSet

public static boolean sDynamoAppServerSet

sJobRegistry

public static atg.servlet.JobRegistry sJobRegistry

JOB_REGISTRY_PATH

public static java.lang.String JOB_REGISTRY_PATH

GENERIC_SESSION_MANAGER_PATH

public static java.lang.String GENERIC_SESSION_MANAGER_PATH

APPSERVER_CONFIG_NUCLEUS_PATH

public static java.lang.String APPSERVER_CONFIG_NUCLEUS_PATH

DYNAMO_SESSION_MANAGER_PATH

public static java.lang.String DYNAMO_SESSION_MANAGER_PATH

DYNAMO_INITIAL_CONTEXT_POOL_PATH

public static java.lang.String DYNAMO_INITIAL_CONTEXT_POOL_PATH

SESSION_NAME_CONTEXT_NAME

public static java.lang.String SESSION_NAME_CONTEXT_NAME

SESSION_RESTORED_MARKER

public static java.lang.String SESSION_RESTORED_MARKER

SESSION_NEEDS_RESTORE

public static java.lang.String SESSION_NEEDS_RESTORE

PRE_FORWARD_URI_ATTR

public static final java.lang.String PRE_FORWARD_URI_ATTR
See Also:
Constant Field Values

PRE_FORWARD_URI_WITH_QUERY_STRING_ATTR

public static final java.lang.String PRE_FORWARD_URI_WITH_QUERY_STRING_ATTR
See Also:
Constant Field Values

POST_FORWARD_URI_ATTR

public static final java.lang.String POST_FORWARD_URI_ATTR
See Also:
Constant Field Values

PRE_FORWARD_CONTEXT_PATH_ATTR

public static final java.lang.String PRE_FORWARD_CONTEXT_PATH_ATTR
See Also:
Constant Field Values

IBM_MANAGED_SERVER_CLASS

public static final java.lang.String IBM_MANAGED_SERVER_CLASS
See Also:
Constant Field Values

APPSERVER_NAME

public static final java.lang.String APPSERVER_NAME
See Also:
Constant Field Values

POST_REQUEST_PROCESSORS_NAME

public static java.lang.String POST_REQUEST_PROCESSORS_NAME

POST_REQUEST_JOB_IDS

public static java.lang.String POST_REQUEST_JOB_IDS

POST_REQUEST_PROCESSOR_OWNER

public static java.lang.String POST_REQUEST_PROCESSOR_OWNER

CONTEXT_PATHS

public static java.lang.String CONTEXT_PATHS

PAGE_FILTER_CHAIN_ATTRIBUTE

public static java.lang.String PAGE_FILTER_CHAIN_ATTRIBUTE

PAGE_FILTER_ENABLED

public static final java.lang.String PAGE_FILTER_ENABLED
See Also:
Constant Field Values

DROPLET_EVENT_SERVLET_NAME

public static final java.lang.String DROPLET_EVENT_SERVLET_NAME
See Also:
Constant Field Values

DAF_DROPLET_EVENT_SERVLET_NAME

public static final java.lang.String DAF_DROPLET_EVENT_SERVLET_NAME
See Also:
Constant Field Values

WINDOW_SESSION_NAME

public static final java.lang.String WINDOW_SESSION_NAME
See Also:
Constant Field Values

HOST_SERVLET_CONTEXT_ATTR

public static final java.lang.String HOST_SERVLET_CONTEXT_ATTR
See Also:
Constant Field Values

mLoggingDebug

public static boolean mLoggingDebug

mLoggingError

public static boolean mLoggingError

sWorkingInitialContext

public static javax.naming.InitialContext sWorkingInitialContext
Returns the UserTransaction object for use by dynamo applications. By using this method instead of the standard J2ee utility, we can ensure that all dynamo applications use a consistent transaction manager even when we are running on a 3rd party app server using dynamo's transaction mechanism.

Constructor Detail

ServletUtil

public ServletUtil()
Method Detail

lookupInInitialContext

public static java.lang.Object lookupInInitialContext(java.lang.String pName)
                                               throws javax.naming.NamingException
Do a lookup using a generic InitialContext... use one from the context pool at DYNAMO_INITIAL_CONTEXT_POOL_PATH if possible.

Throws:
javax.naming.NamingException

getWebsphereServerName

public static java.lang.String getWebsphereServerName()
Returns the name of the Websphere AE server this method was invoked in.
Returns null if the name cannot be determined, or if the current application server is not Websphere AE.


getJspClasspath

public static java.lang.String getJspClasspath(javax.servlet.ServletContext pContext)
If we are on a 3PAS returns the classpath used by that appserver for compiling jsp pages.


getWeblogicJspClasspath

public static java.lang.String getWeblogicJspClasspath()
                                                throws java.lang.NoSuchMethodException,
                                                       java.lang.SecurityException,
                                                       java.lang.IllegalAccessException,
                                                       java.lang.IllegalArgumentException,
                                                       java.lang.reflect.InvocationTargetException
Throws:
java.lang.NoSuchMethodException
java.lang.SecurityException
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.reflect.InvocationTargetException

getWebSphereJspClasspath

public static java.lang.String getWebSphereJspClasspath()
                                                 throws java.lang.NoSuchMethodException,
                                                        java.lang.SecurityException,
                                                        java.lang.IllegalAccessException,
                                                        java.lang.IllegalArgumentException,
                                                        java.lang.reflect.InvocationTargetException
Throws:
java.lang.NoSuchMethodException
java.lang.SecurityException
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.reflect.InvocationTargetException

getJBossJspClasspath

public static java.lang.String getJBossJspClasspath()
                                             throws java.lang.ClassNotFoundException,
                                                    java.lang.NoSuchFieldException,
                                                    java.lang.NoSuchMethodException,
                                                    java.lang.SecurityException,
                                                    java.lang.IllegalAccessException,
                                                    java.lang.IllegalArgumentException,
                                                    java.lang.InstantiationException,
                                                    java.lang.reflect.InvocationTargetException
Throws:
java.lang.ClassNotFoundException
java.lang.NoSuchFieldException
java.lang.NoSuchMethodException
java.lang.SecurityException
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException

getJBossJspClasspath

public static java.lang.String getJBossJspClasspath(javax.servlet.ServletContext sc)
                                             throws java.lang.IllegalStateException,
                                                    java.lang.ClassNotFoundException,
                                                    java.lang.InstantiationException,
                                                    java.lang.IllegalAccessException,
                                                    java.lang.NoSuchFieldException,
                                                    java.lang.SecurityException,
                                                    java.lang.IllegalArgumentException
Parameters:
sc -
Returns:
Throws:
java.lang.IllegalStateException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.NoSuchFieldException
java.lang.SecurityException
java.lang.IllegalArgumentException

getJBoss5JspClasspath

public static java.lang.String getJBoss5JspClasspath(javax.servlet.ServletContext sc)
                                              throws java.lang.IllegalStateException,
                                                     java.lang.IllegalAccessException,
                                                     java.lang.NoSuchFieldException,
                                                     java.lang.NoSuchMethodException,
                                                     java.lang.reflect.InvocationTargetException
Returns JBoss5 class path

Parameters:
sc - servlet context
Returns:
JBoss5 classpath
Throws:
java.lang.IllegalStateException
java.lang.IllegalAccessException
java.lang.NoSuchFieldException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException

getJBoss5PageCompileClasspath

public static java.lang.String getJBoss5PageCompileClasspath()
Returns JBoss5 page compile class path

Returns:
JBoss5 page compile class path

setJBoss5PageCompileClasspath

public static void setJBoss5PageCompileClasspath(javax.servlet.ServletContext sc,
                                                 atg.applauncher.AppLauncher pLauncher)
                                          throws java.lang.IllegalStateException,
                                                 java.lang.IllegalAccessException,
                                                 java.lang.NoSuchFieldException,
                                                 java.lang.NoSuchMethodException,
                                                 java.lang.reflect.InvocationTargetException
Set JBoss5 page compile class path

Parameters:
sc - servlet context
pLauncher - AppLauncher
Throws:
java.lang.IllegalStateException
java.lang.IllegalAccessException
java.lang.NoSuchFieldException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException

getCleanClassPathArrayWithLocallib

public static java.lang.String[] getCleanClassPathArrayWithLocallib(atg.applauncher.AppLauncher pLauncher)
Returns classPath with locallib elements without enries that marked as ignored in manifest files (see ATG-Assembler-Class-Path-Ignore manifest attribute).

Parameters:
pLauncher - AppLauncher
Returns:
String array of classPath elements

flushBeforeInclude

public static void flushBeforeInclude(javax.servlet.jsp.JspWriter pOut)
                               throws java.io.IOException
If the given JspWriter is a BodyContent this method will call writeOut on that BodyContent and all of its enclosing BodyContents.
Finally when a non BodyContent JspWriter is encountered that JspWriter will be flushed with flush().

Throws:
java.io.IOException

flushBeforeInclude

public static void flushBeforeInclude(DynamoHttpServletResponse pRes)
                               throws java.io.IOException
This method should be invoked before an RequestDispatcher.include if one does not have access to PageContext (such as in a servlet).

Parameters:
pRes - The response to attempt to flush before including (at least on WebSphere).
Throws:
java.io.IOException

getSessionManager

public static atg.servlet.sessiontracking.DynamoSessionManager getSessionManager()
Returns the session manager for the current installation.
In DAF this returns a GenericSessionManager in Dynamo it returns a SessionManager


getSessionNameContext

public static NameContext getSessionNameContext(javax.servlet.http.HttpServletRequest pRequest,
                                                javax.servlet.http.HttpSession pSession,
                                                Nucleus pNucleus)
Returns the NameContext associated with a given session. When running in a dynamo j2ee server, the HttpSession is itself a NameContext, but this is not true when using a 3rd party server. This utility method allows you to retrieve the NameContext for a given HttpSession in a platform independent way.


invalidateSessionNameContext

@Deprecated
public static void invalidateSessionNameContext(javax.servlet.http.HttpSession pSession)
Deprecated. 

Flags the main SessionNameContext as invalid. This method should be called before a child session is explicitly invalidated with HttpSession.invalidate(). If the main SessionNameContext cannot be found then this method does nothing.

Note: this version of this method has been deprecated. Please use the request-based version to avoid a potential deadlock during session replication.

Parameters:
pSession - the current HttpSession

invalidateSessionNameContext

public static void invalidateSessionNameContext(javax.servlet.http.HttpServletRequest pRequest,
                                                javax.servlet.http.HttpSession pSession)
Flags the main SessionNameContext as invalid. This method should be called before a child session is explicitly invalidated with HttpSession.invalidate(). If the main SessionNameContext cannot be found then this method does nothing.

Parameters:
pRequest - the current HttpServletRequest
pSession - the current HttpSession

getParentSessionId

public static java.lang.String getParentSessionId(javax.servlet.http.HttpServletRequest pRequest)
Returns the parent session id. This may be different than the request's current session id on app servers which use a separate session id for each web application. For this method to return a reliable result, it should only be called after the SessionNameContext has been initialized for a given request.

Parameters:
pRequest - the request from which to get the session ID.
Returns:
the parent session id.

invalidateSession

@Deprecated
public static void invalidateSession(javax.servlet.http.HttpSession pSession)
Deprecated. 

On DAF this method makes sure that the "parent" session gets invalided when you attempt to invalide a child session. On DAF this method just calls pSession.invalidate()

Note: this version is deprecated in favor of the version that takes a request.


invalidateSession

public static void invalidateSession(javax.servlet.http.HttpServletRequest pRequest,
                                     javax.servlet.http.HttpSession pSession)
On DAF this method makes sure that the "parent" session gets invalided when you attempt to invalide a child session. On DAF this method just calls pSession.invalidate()

Parameters:
pRequest - a request in the session to be invalidated (may be null, but a null value opens the possibilty of deadlock when using asynchronous session replication).
pSession - the session to be invalidated.

setInitProperties

public static void setInitProperties(javax.servlet.Servlet pServlet,
                                     javax.servlet.ServletConfig pConfig,
                                     NameResolver pContext)
                              throws BadValueException
Throws:
BadValueException

convertPropertyValue

public static java.lang.Object convertPropertyValue(java.lang.String pValue,
                                                    java.lang.Class pClass,
                                                    NameResolver pContext)
                                             throws ServiceException
Converts the specified value to the specified class. If the class is not known, then the value is treated as the name of a service in the context. If the class is an array, then the value will be broken up into its comma-separated parts and the value returned will be an array of those parts.

Throws:
ServiceException - if there was a problem with the operation

doPropertySetAsText

public static java.lang.Object doPropertySetAsText(java.lang.Class pClass,
                                                   java.lang.String pValue)
                                            throws javax.servlet.jsp.JspException
Gets an appropriate PropertyEditor and uses it to convert the specified value to the specified class.

Throws:
javax.servlet.jsp.JspException - if there was a problem with the operation

loadServlet

public static javax.servlet.Servlet loadServlet(DynamoHttpServletRequest pRequest,
                                                java.lang.String pName,
                                                java.lang.String pCode,
                                                java.lang.String pCodeBase,
                                                java.util.Properties pArgs)
                                         throws javax.servlet.ServletException
Loads the servlet with the specified, name, code, codebase and arguments.

Throws:
javax.servlet.ServletException - if an error occurred during the operation

callServlet

public static void callServlet(javax.servlet.Servlet pServlet,
                               java.lang.String pName,
                               javax.servlet.ServletRequest pReq,
                               javax.servlet.ServletResponse pRes)
                        throws javax.servlet.ServletException,
                               java.io.IOException
Just invokes the servlet right now. We might need functionality here to make sure that the servlet is not being destroyed as it is getting called eventually.

Throws:
javax.servlet.ServletException
java.io.IOException

isUsingURLRewriting

public static boolean isUsingURLRewriting(javax.servlet.http.HttpServletRequest pRequest)
This method returns true if this request is using URL rewriting.


embed

public static void embed(java.lang.String pPath,
                         javax.servlet.Servlet pServlet,
                         DynamoHttpServletRequest request,
                         javax.servlet.ServletResponse response)
                  throws javax.servlet.ServletException,
                         java.io.IOException
Deprecated. 

Embeds an html or jhtml file into the current request.

Throws:
javax.servlet.ServletException
java.io.IOException

embed

public static void embed(java.lang.String pPath,
                         DynamoHttpServletRequest request,
                         javax.servlet.ServletResponse response)
                  throws javax.servlet.ServletException,
                         java.io.IOException
Embeds an html or jhtml file into the current request. All files sent through this method are passed through the PageCompileServlet.

For this method to work, there must be a PageCompileServlet in the pipeline ahead of the caller of this method.

Parameters:
pPath - the relative URI from the current file, or an absolute URI (not a full URL with http://).
request - the request to embed this file into
response - the response to embed this file into
Throws:
javax.servlet.ServletException
java.io.IOException

serviceWithoutIncludeAttributes

public static void serviceWithoutIncludeAttributes(javax.servlet.Servlet pServlet,
                                                   DynamoHttpServletRequest pRequest,
                                                   javax.servlet.ServletResponse pResponse,
                                                   boolean pIsDynamoResponseAndServlet)
                                            throws java.io.IOException,
                                                   javax.servlet.ServletException
Invoke service ont he specified servlet without any include attributes... saves and restores include attributes, as needed.

Throws:
java.io.IOException
javax.servlet.ServletException

clearIncludeAttributes

protected static void clearIncludeAttributes(javax.servlet.http.HttpServletRequest pRequest)
Blindly clear out all the include attributes.


recordAndClearIncludeAttributes

public static atg.servlet.RequestStateRestorer recordAndClearIncludeAttributes(javax.servlet.http.HttpServletRequest pRequest)
Record and clear (if needed) any servlet include attributes on the request. Tries to be efficient and return a NULL_STATE_RESTORER is there's no state that needs to be restored.


execCgi

public static void execCgi(DynamoHttpServletRequest pRequest,
                           DynamoHttpServletResponse pResponse,
                           java.lang.String pPath,
                           boolean pIsCgi)
                    throws java.io.IOException,
                           javax.servlet.ServletException
Executes the CGI command passed in with pPath.

Throws:
java.io.IOException
javax.servlet.ServletException

fileLastMod

public static java.lang.String fileLastMod(DynamoHttpServletRequest pRequest,
                                           java.lang.String pDocPath)
Finds the file on disk and returns it's last modification date/time formatted according to the DATE_FORMAT request attribute.


fileSize

public static java.lang.String fileSize(DynamoHttpServletRequest pRequest,
                                        java.lang.String pDocPath)
Finds the file on disk and returns it's size in bytes in a string formatted according to the SIZE_FORMAT request attribute.


formattedDate

public static java.lang.String formattedDate(DynamoHttpServletRequest pRequest,
                                             long pTimeMillis,
                                             java.util.TimeZone pTimeZone)
Formats the given date according to the timefmt set by the SSI config command.


setDateFormat

public static void setDateFormat(DynamoHttpServletRequest pRequest,
                                 java.lang.String pSsiFormatStr)
Sets the pagecompile date format attribute on the request. Called by the SSI config command tag. (See ConfigSGMLTree)


getUserLocale

public static java.util.Locale getUserLocale(DynamoHttpServletRequest pRequest,
                                             boolean pUseRequestLocale)
Returns the locale to use when looking up localized messages that will be shown to the user.

The method first searches for a request paramater named locale. This value can be either a java.util.Locale object or a String that represents the locale.

If there is no such request parameter, and if pUseRequestLocale parameter is true, then the locale of the request will be returned if one has been set.

Finally, if the locale cannot be determined by either of these techniques, then the default server locale is used.

Parameters:
pRequest - The Dynamo servlet request from which to derive the locale.
pUseRequestLocale - Flag indicating whether to consult pRequest's requestLocale setting when choosing a locale.
Returns:
The locale to use when looking up user-visible messages.

getUserLocale

public static java.util.Locale getUserLocale(DynamoHttpServletRequest pRequest)
Returns the locale to use when looking up localized messages that will be shown to the user. This method works by searching first for a request parameter named locale, then checking the request itself for a locale setting, and finally returning the default server locale if all else fails.

Parameters:
pRequest - The Dynamo servlet request from which to derive the locale.
Returns:
The locale to use when looking up user-visible messages.

getUserLocale

public static java.util.Locale getUserLocale()
Returns the locale to use when looking up localized messages that will be shown to the user. This method works by searching first for a request parameter named locale, then checking the request itself for a locale setting, and finally returning the default server locale if all else fails.

Returns:
The locale to use when looking up user-visible messages.

resolvePathFromRelativeURL

public static java.lang.String resolvePathFromRelativeURL(java.lang.String pRelativeURL,
                                                          java.lang.String pFilePath)
                                                   throws java.lang.IllegalArgumentException
Takes a relative URL (i.e. the src of a droplet) and an absolute file system path. It resolves this into an absolute droplet path removing the ../'s from the path.

Parameters:
pPath - The pure relative path (i.e. does not start with "/") to be resolved.
pWorkingDirectory - The working directory to resolve against, which should begin and end with the "/" character.
Throws:
java.lang.IllegalArgumentException

toString

public static java.lang.String toString(java.lang.Object obj)
Returns the specified value as a string like String.valueOf, except if the value is null, an empty string is returned instead.


toString

public static java.lang.String toString(char[] data)

toString

public static java.lang.String toString(boolean b)

toString

public static java.lang.String toString(char c)

toString

public static java.lang.String toString(int i)

toString

public static java.lang.String toString(long l)

toString

public static java.lang.String toString(float f)

toString

public static java.lang.String toString(double d)

escapeHtmlString

public static java.lang.String escapeHtmlString(java.lang.String pStr)
Returns a string that is properly escaped for use either as an HTML attribute value or an HTML content section.

The characters &, <, >, and " are all converted to &&, &<, &>, and &" respectively.

Parameters:
pStr - the string to be escaped
Returns:
the escaped string

escapeHtmlString

public static java.lang.String escapeHtmlString(java.lang.String pStr,
                                                boolean pEscapeAmp)
Returns a string that is properly escaped for use either as an HTML attribute value or an HTML content section.

The characters &, <, >, and " are all converted to &&, &<, &>, and &" respectively.

Parameters:
pStr - the string to be escaped
pEscapeAmp - whether to escape ampersand
Returns:
the escaped string

getStackTrace

public static java.lang.String getStackTrace(java.lang.Throwable pThrowable)
Returns the stack trace of an exception as a string. Since ServletOutputStream is not a PrintStream you cannot call the Throwable.printStrackTrace(PrintStream) method directly. This allows you to get a String representation of the stack trace so it can be printed


printStackTrace

public static void printStackTrace(java.lang.Throwable pThrowable,
                                   javax.servlet.ServletOutputStream pOut)
Prints the stack trace of an exception with the given ServletOutputStream. Since ServletOutputStream is not a PrintStream you cannot call the Throwable.printStrackTrace(PrintStream) method directly. This provides a convenient method to print stack traces.


setNoCacheHeaders

public static void setNoCacheHeaders(DynamoHttpServletResponse pResponse)
This method sets the HTTP headers Pragma: no-cache, and Expires: in an attempt to prevent a browser or proxy from caching a response.


setNoCacheHeaders

public static void setNoCacheHeaders(javax.servlet.http.HttpServletResponse pResponse)
This method sets the HTTP headers Pragma: no-cache, and Expires: in an attempt to prevent a browser or proxy from caching a response.


setDynamicContentHeaders

public static void setDynamicContentHeaders(DynamoHttpServletRequest pRequest,
                                            DynamoHttpServletResponse pResponse)
This method calls setNoCacheHeaders on pResponse if it determines that pRequest comes from a proxy server, or a user-agent that is known to be a bad-cacher (i.e. one that caches documents that do not have a last-modified header). You can call this method from any servlet that has dynamic content to ensure that the content for that servlet will not be cached by a malicious browser or proxy server.


convertStringToDictionary

public static java.util.Dictionary convertStringToDictionary(DynamoHttpServletRequest pRequest,
                                                             java.lang.String pValue)
                                                      throws javax.servlet.ServletException
For a given string value of the form:
name1=strValue1, name2=param:paramValue2,
 name3=bean:propertyValue3
this method returns a Dictionary that contains the resolved values.

Throws:
javax.servlet.ServletException - if one of the referenced property values is invalid.

resolveTranslatedPathFromURI

public static java.lang.String resolveTranslatedPathFromURI(java.lang.String pPath,
                                                            DynamoHttpServletRequest pRequest)
Takes a URI and a request it is associated with. This will resolve to an absolute path.

Parameters:
pPath - a URI
pRequest - the request to resolve against.

valuesMatch

public static boolean valuesMatch(java.lang.Object pValue1,
                                  java.lang.Object pValue2)
This returns true if the first argument matches the second argument. The first argument can either be a scalar, array, or a collection. The second argument must be a scalar. If the first argument is a scalar, the values must have the same string value to match. If the first argument is an array, a match occurs if the second value has the same string value of an element of the first value.

See Also:
valuesMatchIgnoreCase(Object, Object)

valuesMatchIgnoreCase

public static boolean valuesMatchIgnoreCase(java.lang.Object pValue1,
                                            java.lang.Object pValue2)

getPropertyValue

public static java.lang.Object getPropertyValue(javax.servlet.ServletRequest pRequest,
                                                java.lang.String pPropertyPath)
                                         throws javax.servlet.ServletException
Returns the object property value for the specified component and the specified path. If this method is called from within a .jhtml page, any imports used in that page (from the importbean tag) are used to expand the component path name.

Parameters:
pPropertyPath - the path name to the property in the form:
{component path}.{property}.{property}
Returns:
the value of the property
Throws:
javax.servlet.ServletException - thrown if an error occurs trying to find the component, or trying to get one of the property values.

getPropertyValue

public static java.lang.Object getPropertyValue(DynamoHttpServletRequest pRequest,
                                                java.lang.String pPropertyPath)
                                         throws javax.servlet.ServletException
Returns the object property value for the specified component and the specified path. If this method is called from within a .jhtml page, any imports used in that page (from the importbean tag) are used to expand the component path name.

Parameters:
pPropertyPath - the path name to the property in the form:
{component path}.{property}.{property}
Returns:
the value of the property
Throws:
javax.servlet.ServletException - thrown if an error occurs trying to find the component, or trying to get one of the property values.

setPropertyValue

public static boolean setPropertyValue(javax.servlet.ServletRequest pReq,
                                       javax.servlet.ServletResponse pRes,
                                       java.lang.String pPropertyPath,
                                       java.lang.Object pValue)
                                throws javax.servlet.ServletException,
                                       java.io.IOException
This method sets the property value specified by the pPropertyPath parameter to the value specified by the pValue parameter. If this particular bean has a handleX method with this name, this method is called too. If the bean has both a setX and handleX methods, we first call setX, then handleX.

If this method is called from within a jhtml page with a relative path of a component, the imports in the page are used to expand the property name.

Parameters:
pReq - the request which is used to both resolve the comopent and to pass to the handleX method .
pRes - the response which is passed to handleX method
pPropertyPath - the path name to the property in the form:
{component path}.{property}.{property}
pValue - the value of the property. Data type conversion is performed to convert String values into values of the appropriate type for the property.
Returns:
if the property has a handleX method, this method returns the value returned by that method. Otherwise, it returns true.
Throws:
javax.servlet.ServletException - thrown if an error occurs trying to find the component, or trying to get one of the intermediate property values, or trying to set the final property value. A ServletException can also be thrown by one of the handleX methods, in which case that exception is propagated up through this call.
java.io.IOException - thrown if the handleX methods throws an IOException

setPropertyValue

public static boolean setPropertyValue(DynamoHttpServletRequest pReq,
                                       DynamoHttpServletResponse pRes,
                                       java.lang.String pPropertyPath,
                                       java.lang.Object pValue)
                                throws javax.servlet.ServletException,
                                       java.io.IOException
This method sets the property value specified by the pPropertyPath parameter to the value specified by the pValue parameter. If this particular bean has a handleX method with this name, this method is called too. If the bean has both a setX and handleX methods, we first call setX, then handleX.

If this method is called from within a jhtml page with a relative path of a component, the imports in the page are used to expand the property name.

Parameters:
pReq - the request which is used to both resolve the comopent and to pass to the handleX method .
pRes - the response which is passed to handleX method
pPropertyPath - the path name to the property in the form:
{component path}.{property}.{property}
pValue - the value of the property. Data type conversion is performed to convert String values into values of the appropriate type for the property.
Returns:
if the property has a handleX method, this method returns the value returned by that method. Otherwise, it returns true.
Throws:
javax.servlet.ServletException - thrown if an error occurs trying to find the component, or trying to get one of the intermediate property values, or trying to set the final property value. A ServletException can also be thrown by one of the handleX methods, in which case that exception is propagated up through this call.
java.io.IOException - thrown if the handleX methods throws an IOException

getRequestURI

public static java.lang.String getRequestURI(javax.servlet.ServletRequest pReq)
Return the Dynamo specific ReuestURI, this can be different from pReq.getRequestURI() in the case of running with a different app server. DynamoHeadServlet can fix a broken getRequestURI() if the property DynamoHeadServlet.fixRequestURI is set to true.

Parameters:
pReq - the request
Returns:
the Dynamo value of request URI

escapeURLString

public static java.lang.String escapeURLString(java.lang.String pStr)
Return the passed in String as a URL encoded String. This version of this method is a lot more efficient than using the similar java.net.URLEncoder class.

Parameters:
pStr - the String to be translated.
Returns:
the URL encoded String

getNewBaseDirectory

public static java.lang.String getNewBaseDirectory(DynamoHttpServletRequest pRequest,
                                                   javax.servlet.ServletContext pServletContext,
                                                   java.lang.String pNewURI)
Return the new directory for the specified URL, if it differs from the current base directory.


getTagManager

public static atg.servlet.pagecompile.taglib.TagManager getTagManager(DynamoHttpServletRequest pRequest,
                                                                      java.lang.String pTagLibURI,
                                                                      java.lang.String pResovledTagLibURI,
                                                                      java.lang.String pTagName,
                                                                      int pLineNumber)
                                                               throws javax.servlet.ServletException
Parameters:
pLineNumber - the line number of the taglib reference.
Throws:
javax.servlet.ServletException

getTagManager

public static atg.servlet.pagecompile.taglib.TagManager getTagManager(DynamoHttpServletRequest pRequest,
                                                                      java.lang.String pTagLibURI,
                                                                      java.lang.String pTagName,
                                                                      int pLineNumber)
                                                               throws javax.servlet.ServletException
Parameters:
pLineNumber - the line number of the taglib reference.
Throws:
javax.servlet.ServletException

getCurrentRequestURI

public static java.lang.String getCurrentRequestURI(javax.servlet.http.HttpServletRequest pRequest)
Get the current request URI... use the Servlet 2.2 INCLUDE attribute as needed.

Parameters:
pRequest - the request to get the URI of

getCurrentContextPath

public static java.lang.String getCurrentContextPath(javax.servlet.http.HttpServletRequest pRequest)
Get the current context path... use the Servlet 2.2 INCLUDE attribute as needed.

Parameters:
pRequest - the request to get the context path of

getCurrentContextPath

public static java.lang.String getCurrentContextPath(javax.servlet.http.HttpServletRequest pRequest,
                                                     boolean pInInclude)
Get the current context path... use the Servlet 2.2 INCLUDE attribute as needed.

Parameters:
pRequest - the request to get the context path of
pInInclude - whether we are currently in an RequestDispatcher.include()

getCurrentServletContext

public static javax.servlet.ServletContext getCurrentServletContext(javax.servlet.http.HttpServletRequest pRequest)
Get the current requests ServletContext.


getCurrentServletContextName

public static java.lang.String getCurrentServletContextName(javax.servlet.http.HttpServletRequest pRequest)
Get the current requests ServletContextName. This is the from the web.xml file. This can return null since is optional.


getCurrentServletPath

public static java.lang.String getCurrentServletPath(javax.servlet.http.HttpServletRequest pRequest)
Get the current serlvet path... use the Servlet 2.2 INCLUDE attribute as needed.

Parameters:
pRequest - the request to get the servlet path of

getCurrentServletPath

public static java.lang.String getCurrentServletPath(javax.servlet.http.HttpServletRequest pRequest,
                                                     boolean pInInclude)
Get the current serlvet path... use the Servlet 2.2 INCLUDE attribute as needed.

Parameters:
pRequest - the request to get the servlet path of
pInInclude - whether we are currently in an RequestDispatcher.include()

getCurrentPathInfo

public static java.lang.String getCurrentPathInfo(javax.servlet.http.HttpServletRequest pRequest)
Get the current path info... use the Servlet 2.2 INCLUDE attribute as needed.

Parameters:
pRequest - the request to get the path info of

getCurrentPathInfo

public static java.lang.String getCurrentPathInfo(javax.servlet.http.HttpServletRequest pRequest,
                                                  boolean pInInclude)
Get the current path info... use the Servlet 2.2 INCLUDE attribute as needed.

Parameters:
pRequest - the request to get the path info of
pInInclude - whether we are currently in an RequestDispatcher.include()

getCurrentQueryString

public static java.lang.String getCurrentQueryString(javax.servlet.http.HttpServletRequest pRequest)
Get the current query string... use the Servlet 2.2 INCLUDE attribute as needed.

Parameters:
pRequest - the request to get the query string of

getCurrentQueryString

public static java.lang.String getCurrentQueryString(javax.servlet.http.HttpServletRequest pRequest,
                                                     boolean pInInclude)
Get the current query string... use the Servlet 2.2 INCLUDE attribute as needed.

Parameters:
pRequest - the request to get the query string of
pInInclude - whether we are currently in an RequestDispatcher.include()

getCurrentPathTranslated

public static java.lang.String getCurrentPathTranslated(javax.servlet.http.HttpServletRequest pRequest)
Get the current path translated... use the Servlet 2.2 INCLUDE attribute as needed.

Parameters:
pRequest - the request to get the path translated value from

getLiteralCurrentPathTranslated

public static java.lang.String getLiteralCurrentPathTranslated(javax.servlet.http.HttpServletRequest pRequest,
                                                               boolean pInInclude)
Get the current path translated... use the Servlet 2.2 INCLUDE attribute as needed.

Parameters:
pRequest - the request to get the path translated value from
pInInclude - whether we are currently in an RequestDispatcher.include()

getCurrentPathTranslated

public static java.lang.String getCurrentPathTranslated(javax.servlet.http.HttpServletRequest pRequest,
                                                        boolean pInInclude)
Get the current path translated... use the Servlet 2.2 INCLUDE attribute as needed. Fall back to attempting to calculate it, if need be.

Parameters:
pRequest - the request to get the path translated value from
pInInclude - whether we are currently in an RequestDispatcher.include()

getRequestURI

public static java.lang.String getRequestURI(javax.servlet.http.HttpServletRequest pRequest,
                                             java.lang.String pURL)
Get the requestURI that will be returned when the server requests the URL. Query params are stripped off.

Parameters:
pURL - the url to get the requestURI from

getRequestURI

public static java.lang.String getRequestURI(javax.servlet.http.HttpServletRequest pRequest,
                                             java.lang.String pURL,
                                             boolean pStripQueryParams)
Get the requestURI that will be returned when the server requests the URL

Parameters:
pURL - the url to get the requestURI from
pStripQueryParams - if true, query params will be stripped off

getRequestURI

public static java.lang.String getRequestURI(DynamoHttpServletRequest pRequest,
                                             java.lang.String pURL)
Get the requestURI that will be returned when the server requests the URL. Query params are stripped off.

Parameters:
pURL - the url to get the requestURI from

getRequestURI

public static java.lang.String getRequestURI(DynamoHttpServletRequest pRequest,
                                             java.lang.String pURL,
                                             boolean pStripQueryParams)
Get the requestURI that will be returned when the server requests the URL

Parameters:
pURL - the url to get the requestURI from
pStripQueryParams - if true, query params will be stripped off

getRequestURL

public static java.lang.String getRequestURL(javax.servlet.http.HttpServletRequest pRequest,
                                             java.lang.String pURI)
Given a potentially relative URL of the form "/xxx" or "../xxx", this returns the absolute URL you'd use to request this page (i.e. http://.../xxx)


getCurrentRequest

public static DynamoHttpServletRequest getCurrentRequest()
Returns the request associated with the current thread, null if there is no such request.


getGlobalSession

public static javax.servlet.http.HttpSession getGlobalSession(boolean create)
Get the global, parent session.

Parameters:
create - whether to create a session if none exists.

setCurrentRequest

public static DynamoHttpServletRequest setCurrentRequest(DynamoHttpServletRequest pRequest)
Sets the current response object associated with this request.


getCurrentResponse

public static DynamoHttpServletResponse getCurrentResponse()
Returns the response associated with the current thread, null if there is no such response.


setCurrentResponse

public static DynamoHttpServletResponse setCurrentResponse(DynamoHttpServletResponse pResponse)
Sets the current response object associated with this request.


getCurrentUserProfile

public static RepositoryItem getCurrentUserProfile()
Returns the profile associated with the current thread, null if there is no such profile.


setCurrentUserProfile

public static RepositoryItem setCurrentUserProfile(RepositoryItem pItem)
Sets the current user profile


setStartRequestThreadPriority

public static void setStartRequestThreadPriority()
Attempts to keep request handling thread priority higher while it's actually serving a page. To do so we first look at the thread's ServletThreadContext. The ServletThreadContext is associated with the thread via a ThreadLocal object. If the ServletThreadContext's mOriginalThreadPriority is -1 it means that it's the first time this thread has run through the pipeline. In this case we note the current thread priority in the mOriginalThreadPriority variable and do nothing else. In the case that the mOriginalThreadPriority variable is not -1 we assume that the request has travelled through the pipeline and had its priority dropped by one just as it exits the pipeline. We now want to increase the priority back to its original value while it's running through the pipeline.


setEndRequestThreadPriority

public static void setEndRequestThreadPriority()
Called at the end of the request. Drops the current Thread's priority by one since this request is no longer serving content. TODO: Need to monitor threads that we have dropped the priority on. If they don't come back through the pipeline within some timeout period we should put each thread's priority back to original values. The reason we monitor them is that the app server could be using the thread for some other non ATG application and we don't want to disturb that application by dropping the priority of the threads serving its content.


getDynamoResponse

public static DynamoHttpServletResponse getDynamoResponse(javax.servlet.ServletRequest pRequest,
                                                          javax.servlet.ServletResponse pResponse)
Returns the DynamoHttpServletResponse associated with the current request


getDynamoRequest

public static DynamoHttpServletRequest getDynamoRequest(javax.servlet.ServletContext pContext,
                                                        javax.servlet.ServletRequest pRequest,
                                                        javax.servlet.ServletResponse pResponse)
                                                 throws java.io.IOException,
                                                        javax.servlet.ServletException
Get's the DynamoHttpServletRequest, creating it if necessary. This method will execute the startRequestServlet if it exists as an attribute on the request.

Throws:
java.io.IOException
javax.servlet.ServletException

updateRequestResponse

public static void updateRequestResponse(javax.servlet.ServletRequest pRequest,
                                         javax.servlet.ServletResponse pResponse)
Makes sure that the underlying request/response of the current dynamo request/response matches that of the current request.

This method modifies the Dynamo response found in the request attribute DynamoHttpServletRequest.ATTRIBUTE_NAME


getDynamoRequest

public static DynamoHttpServletRequest getDynamoRequest(javax.servlet.ServletRequest pRequest)
Retrieves the DynamoHttpServletRequest from the given regular ServletRequest. If this method is called before the DynamoHttpServletRequest object has been initialized (either in a DynamoServlet, or from a dsp:page tag), then it will return null.


addPostRequestProcessor

public static void addPostRequestProcessor(DynamoHttpServletRequest pRequest,
                                           DynamoHttpServletResponse pResponse,
                                           atg.servlet.PostRequestProcessor pProcessor,
                                           java.lang.String pOwnerName)
                                    throws javax.servlet.ServletException,
                                           java.io.IOException
Pipeline servlets that require actions to be performed after the completion of the request (usually to clean up some action performed before calling "passRequest") should not directly perform those actions after calling passRequest. Instead, they should package those actions up into a PastRequestProcessor and call this method after calling passRequest. DAS or DAF will call the PostRequestProcessor at the appropriate time to make sure the actions are performed after the request is processed.

Parameters:
pOwnerName - The nucleus path of the servlet that is calling this method is adding the post request processor. This id is used to determine if there was an attempt to add a processor twice for the same servlet in the same request.
Throws:
javax.servlet.ServletException
java.io.IOException

processPostRequestProcessors

public static void processPostRequestProcessors(DynamoHttpServletRequest pRequest,
                                                DynamoHttpServletResponse pResponse)
Executes the post request processors. This method should only be called by the Dynamo framework.


getRequestURIFromPathInfo

public static java.lang.String getRequestURIFromPathInfo(javax.servlet.http.HttpServletRequest pRequest,
                                                         java.lang.String pPath)
Returns the given path prepended with the contextPath and servletPath (if they are set)


convertToNativeString

public static java.lang.String convertToNativeString(java.lang.String pValue,
                                                     java.lang.String pEncoding)
This method converts the unicode string supplied to a string encoded in the native encoding supplied. The returned string has the 0 in the upper byte and the native char encoded in the low byte of each char.


isDynamoJ2EEServer

public static boolean isDynamoJ2EEServer()
This method can be used to determine whether or not you are running on a dynamo J2EE server.


getContentCharset

public static java.lang.String getContentCharset(java.lang.String mimeType)
Returns the content charset with the default if it is not set


getContentCharset

public static java.lang.String getContentCharset(java.lang.String mimeType,
                                                 java.lang.String pDefault)
Returns the content type used for reading this data. If not specified, uses the HTTP default of ISO 8859/1 translation. See RFC 2045 for details of the syntax; briefly it's:

        mimeType ::= type "/" subtype [ ";" attribute "=" value]* ;
        attribute ::= case insensitive token ;
        value ::= token | quoted-string ;
        token ::= any us-ascii character except space, ctls,
                or 'tspecials' where 'tspecials' are
                ()<>@ [],:; /\?="

 

Annoyingly enough, comments are allowed ... so


        text/html; charset="utf-8" (packed UNICODE)

 
is legal.

Parameters:
mimeType - an RFC 2045 style MIME type string

isPageFilterEnabled

public static boolean isPageFilterEnabled(DynamoHttpServletRequest pRequest)
Returns true if DAF requests are being handled by a servlet 2.3 filter and funneled through the dafpipline.


setIsDynamoAppserver

public static void setIsDynamoAppserver(boolean pDynamoAppServer)
Deprecated. 

Set whether Dynamo is the current AppServer. At this point, also look at the atg.dynamo.appserver property to determine which appserver we are currently running.

See Also:
atg.service.dynamo.AppServerConfig.setDynamo()

getAppServerConfig

public static atg.service.dynamo.AppServerConfig getAppServerConfig()

isWebLogic

public static boolean isWebLogic()
Return true if we are running on WebLogic.


isGenericJ2EEServer

public static boolean isGenericJ2EEServer()
Return true if we are running on a Tomcat servlet container.

Returns:

isJBoss

public static boolean isJBoss()
Return true if we are running on a Tomcat servlet container.

Returns:

setIsJBoss5

public static void setIsJBoss5(boolean pIsJboss5)

isJBoss5

public static boolean isJBoss5()

isWebSphere

public static boolean isWebSphere()
Return true if we are running on WebSphere.


inInclude

public static boolean inInclude(javax.servlet.ServletRequest pRequest)
Whether we are current within a RequestDispatcher.include()


getLocalRequestDispatcher

public static javax.servlet.RequestDispatcher getLocalRequestDispatcher(javax.servlet.http.HttpServletRequest pRequest,
                                                                        java.lang.String pPath)
Returns a request dispatcher for pPath in the curent web-app. If pPath is relative (doesn't begin with a slash), uses the "current" location to compute the request dispatcher

Parameters:
pRequest - the request from which the request dispatcher will be obtained (also used for calculating the current location for relative paths).
pPath - The path within the current web-app to which to dispatch.

getRequestDispatcher

public static javax.servlet.RequestDispatcher getRequestDispatcher(javax.servlet.http.HttpServletRequest pRequest,
                                                                   java.lang.String pContextPath,
                                                                   java.lang.String pPath)
Returns a request dispatcher for pPath in the curent web-app. If pPath is relative (doesn't begin with a slash) and pContextPath is null, uses the "current" location to compute the request dispatcher

Parameters:
pRequest - the request from which the request dispatcher will be obtained (also used for calculating the current location for relative paths).
pContextPath - the context root of the web application to be dispatched into. Null means use the current web-app.
pPath - The path within the specified web-app to which to dispatch
Returns:
The RequestDispatcher, or null if the context couldn't be found.

invokeInclude

public static void invokeInclude(javax.servlet.RequestDispatcher pDispatcher,
                                 javax.servlet.ServletRequest pRequest,
                                 javax.servlet.ServletResponse pResponse)
                          throws java.io.IOException,
                                 javax.servlet.ServletException
Invoke an include, and restore the state of the dynamo request and respose pointers afterwards.

Parameters:
pDispatcher - the request display whose include method should be invoked.
pRequest - the request to pass into RequestDispatcher.include()
pResponse - the respose to pass into RequestDispatcher.include()
Throws:
java.io.IOException
javax.servlet.ServletException

invokeNoFlushInclude

public static void invokeNoFlushInclude(javax.servlet.RequestDispatcher pDispatcher,
                                        javax.servlet.ServletRequest pRequest,
                                        javax.servlet.ServletResponse pResponse)
                                 throws java.io.IOException,
                                        javax.servlet.ServletException
Invoke an include which attempts NOT to flush.

Throws:
java.io.IOException
javax.servlet.ServletException

makeURIAbsoluteURL

public static java.lang.String makeURIAbsoluteURL(java.lang.String pLocation,
                                                  DynamoHttpServletRequest pRequest)
Make a relative path an absolute URI (no host or protocol).


makeURIAbsoluteURL

public static java.lang.String makeURIAbsoluteURL(java.lang.String pLocation,
                                                  javax.servlet.http.HttpServletRequest pRequest,
                                                  int pEncodeContextPathMode,
                                                  boolean pEncodeServletPath)
Make a relative path an absolute URI (no host or protocol).

Parameters:
pLocation - the location... possibly a relative URI
pRequest - the request
pEncodeContextPathMode - the mode that determines whether we could prepend the context path.
pEncodeServletPath - whether to encode the servelt path.

prependSchemeAndHost

public static java.lang.String prependSchemeAndHost(javax.servlet.http.HttpServletRequest pRequest,
                                                    java.lang.String pURI)
Prepend the scheme and the host (and possibly port) as appropriate.

Parameters:
pRequest - the request from which to obtain scheme serverName, and serverPort.
pURI - the to append to the result (should begin with a slash).

prependSchemeAndHost

public static java.lang.String prependSchemeAndHost(java.lang.String pScheme,
                                                    java.lang.String pHost,
                                                    int pPort,
                                                    java.lang.String pURI)
Prepend the scheme and the host (and possibly port) as appropriate.

Parameters:
pScheme - the scheme to prepend (typically "http" or "https")
pHost - the name of the host to prepend
pPort - the port to prepend (if isn't the default for the scheme)
pURI - the URI to append to the result.

makeURIAbsolute

public static java.lang.String makeURIAbsolute(java.lang.String pLocation,
                                               DynamoHttpServletRequest pRequest)
Make a relative path an absolute URI (no host or protocol).


makeURIAbsolute

public static java.lang.String makeURIAbsolute(java.lang.String pLocation,
                                               javax.servlet.http.HttpServletRequest pRequest,
                                               int pEncodeContextPathMode,
                                               boolean pEncodeServletPath)
Make a relative path an absolute URI (no host or protocol).


getHostHeader

public static java.lang.String getHostHeader(javax.servlet.http.HttpServletRequest pRequest)
Return the host header. Works around an IE bug.


processRedirectURL

public static java.lang.String processRedirectURL(java.lang.String pPath,
                                                  DynamoHttpServletRequest pRequest,
                                                  boolean pEncodeSessionId)
Handles the path processing required of Servlet 2.3's rendition of sendRedirect(). It detects if the provided URL is relative or absolute. If the latter it passes through unchanged. If the former, there are two possibilities: In either case it also makes sure the scheme, host and port are included.


isEquivalentCharset

public static boolean isEquivalentCharset(java.lang.String pOldCharset,
                                          java.lang.String pNewCharset)
Returns true if the two charsets are *effectively* equivalent. The only case where this is true is "ASCII" (or "US-ASCII") and "ISO-8859-1". NOTE: the assertion that these charsets are equivalent is used throughout our PageCompiler code so it seems safe to use here.


checkIsSingleByteEncoding

public static boolean checkIsSingleByteEncoding(java.lang.String pEncoding)
Returns false if the provided character encoding requires a reader/writer, true if it doesn't. In the interest of speed case is not checked.

See Also:
checkIsSingleByteEncodingIgnoringCase

checkIsSingleByteEncodingIgnoringCase

public static boolean checkIsSingleByteEncodingIgnoringCase(java.lang.String pEncoding)
Returns false if the provided character encoding requires a reader/writer, true if it doesn't. Case sensitive.


checkIsValidCharacterEncoding

public static boolean checkIsValidCharacterEncoding(java.lang.String pEncoding)
Determines whether the provided encoding is a valid and supported by the current VM. Returns true if it is valid, false otherwise.

Since Sun appears not to provide a registry or programmatic method of listing valid encodings we resort to trying to create a reader with the provided encoding and recording the results in a hashtable. Ick.


valuesForMultiValuedHeader

public static java.lang.Object valuesForMultiValuedHeader(java.lang.String pHeaderName,
                                                          java.lang.String pHeaderValue,
                                                          java.util.Vector pDest)

setUserTransactionURL

public static void setUserTransactionURL(java.lang.String pURL)
Sets the JNDI URL for use in retrieving the UserTransaction object. When running on a non-dynamo app server, we may still want to use dynamo's transaction manager.


getUserTransactionURL

public static java.lang.String getUserTransactionURL()
Returns the URL used to retrieve UserTransaction objects.


setUseExternalTransactionManager

public static void setUseExternalTransactionManager(boolean pUseExternalTransactionManager)
Sets the flag to indicate if we are to use the external app servers transaction manager to avoid starting dynamo's transaction manager


getUseExternalTransactionManager

public static boolean getUseExternalTransactionManager()
Returns the true if we are using the external app server Transaction Manager


getUserTransaction

public static javax.transaction.UserTransaction getUserTransaction()

getParamDelimiter

public static java.lang.String getParamDelimiter(DynamoHttpServletRequest pReq)
Returns the Parameter Delimiter for a request. If the Mime Type is not found in the PageCompileServlet.mMimeToParamDelimiterMap the default param Delimiter ('&') is returned.


handleJspTagIOException

public static void handleJspTagIOException(java.io.IOException pException)
                                    throws javax.servlet.jsp.JspException
Utility method to attempt to "do the right thing" when encountering an IOException inside a JSP Tag, whose methods cannot throw IOException, so much throw some kind of JspException.

Throws:
javax.servlet.jsp.JspException

handleJspTagIOException

public static void handleJspTagIOException(java.lang.String pMessage,
                                           java.io.IOException pException)
                                    throws javax.servlet.jsp.JspException
Utility method to attempt to "do the right thing" when encountering an IOException inside a JSP Tag, whose methods cannot throw IOException, so much throw some kind of JspException.

Throws:
javax.servlet.jsp.JspException

checkOutTag

public javax.servlet.jsp.tagext.Tag checkOutTag(atg.servlet.pagecompile.taglib.TagManager pTagManager,
                                                atg.servlet.pagecompile.taglib.TagWrapper[] pWrappers,
                                                int pIndex,
                                                java.lang.String pAttSet)
                                         throws java.lang.IllegalAccessException,
                                                java.lang.InstantiationException
Check out a TagWrapper from pTagManager, and set the pIndex element of the pWrappers array to the checked out TagWrapper.

Throws:
java.lang.IllegalAccessException
java.lang.InstantiationException

checkOutInitTag

public static javax.servlet.jsp.tagext.Tag checkOutInitTag(atg.servlet.pagecompile.taglib.TagManager pTagManager,
                                                           atg.servlet.pagecompile.taglib.TagWrapper[] pWrappers,
                                                           int pIndex,
                                                           java.lang.String pAttSet,
                                                           javax.servlet.jsp.PageContext pPageContext,
                                                           javax.servlet.jsp.tagext.Tag pParentTag)
                                                    throws java.lang.IllegalAccessException,
                                                           java.lang.InstantiationException
Check out a TagWrapper from pTagManager, and set the pIndex element of the pWrappers array to the checked out TagWrapper. Then the pageContext and parentTag properties with the corresponding parameters.

Throws:
java.lang.IllegalAccessException
java.lang.InstantiationException

initTag

public static javax.servlet.jsp.tagext.Tag initTag(javax.servlet.jsp.tagext.Tag pTag,
                                                   javax.servlet.jsp.tagext.Tag[] pTags,
                                                   int pIndex,
                                                   javax.servlet.jsp.PageContext pPageContext,
                                                   javax.servlet.jsp.tagext.Tag pParentTag)
                                            throws java.lang.IllegalAccessException,
                                                   java.lang.InstantiationException
Initialize pTag by setting the pageContext and parentTag. Also record the tag instance in the pIndex element of the pTags array.

Throws:
java.lang.IllegalAccessException
java.lang.InstantiationException

checkInTag

public static void checkInTag(atg.servlet.pagecompile.taglib.TagWrapper[] pWrappers,
                              int pIndex)
Check in the tag at pIndex of pWrappers. Checking in also calls release on that tag. Also resets the pIndex element of pWrappers to null, to record that release has been called on it.


releaseTag

public static void releaseTag(javax.servlet.jsp.tagext.Tag[] pTags,
                              int pIndex)
Call release on the tag at pIndex of pTags. Also resets the pIndex element of pTags to null, to record that release has been called on it.


cleanUpTags

public static java.lang.Throwable cleanUpTags(atg.servlet.pagecompile.taglib.TagWrapper[] pWrappers)
Run through the pWrappers array, check-in any tags still in the list.

Parameters:
pWrappers - The array of checked-out but not yet checked-in TagWrappers.

cleanUpTags

public static java.lang.Throwable cleanUpTags(javax.servlet.jsp.tagext.Tag[] pTags)
Run through the pTags array, releasing any tags still in the list.

Parameters:
pWrappers - The array of checked-out but not yet checked-in Tags.

pushBody

public static javax.servlet.jsp.JspWriter pushBody(javax.servlet.jsp.PageContext pPageContext,
                                                   boolean[] pBodyContentsPushed,
                                                   int pIndex)
Do a pushBody, and record at pIndex of pBodyContentsPushed that that body was pushed.


popBody

public static javax.servlet.jsp.JspWriter popBody(javax.servlet.jsp.PageContext pPageContext,
                                                  boolean[] pBodyContentsPushed,
                                                  int pIndex)
Do a popBody, and record at pIndex of pBodyContentsPushed that that body was popped.


popBodyContents

public static javax.servlet.jsp.JspWriter popBodyContents(javax.servlet.jsp.PageContext pPageContext,
                                                          javax.servlet.jsp.JspWriter pOut,
                                                          boolean[] pBodyContentsPushed)
Run through the pBodyContentsPushed boolean array, and pop any body contents that are marked as pushed.


popBodyContents

public static javax.servlet.jsp.JspWriter popBodyContents(javax.servlet.jsp.PageContext pPageContext,
                                                          javax.servlet.jsp.JspWriter pOut,
                                                          boolean[] pBodyContentsPushed,
                                                          int pFromIndex,
                                                          int pToIndex)
Run through a specific range of the the pBodyContentsPushed boolean array, and pop any body contents that are marked as pushed.


getDropletEventServlet

public static DropletEventServlet getDropletEventServlet()
                                                  throws javax.servlet.ServletException
Returns the DropletEventServlet, extracting it from Dynamo through JNDI.

Throws:
javax.servlet.ServletException

getWindowSession

public static atg.nucleus.WindowScopeSession getWindowSession()

setParentSessionIdRequestAttribute

public static void setParentSessionIdRequestAttribute(javax.servlet.http.HttpServletRequest pRequest,
                                                      java.lang.String pParentSessionId)
Set the parent session id request attribute to hold the specified parent session id.

Parameters:
pRequest - the request in which to store the parent session ID.
pParentSessionId - the parent session id to set.

setParentSessionIdAttribute

public static void setParentSessionIdAttribute(javax.servlet.http.HttpSession pSession,
                                               java.lang.String pParentSessionId)
Set the parent session id attribute to hold the specified parent session id.

Parameters:
pSession - the session in which to store the parent session ID.
pParentSessionId - the parent session id to set.

getParentSessionIdFromAttribute

public static java.lang.String getParentSessionIdFromAttribute(javax.servlet.http.HttpServletRequest pRequest,
                                                               javax.servlet.http.HttpSession pSession)
Return the parent session id of the session by fetching from the holder contains in the PARENT_SESSION_ID_ATTR session attribute.

Parameters:
pRequest - the request from which to first attempt to get the parent session id (ignored if null)
pSession - the session from which to get the parent session id.
Returns:
the parent session id, or null if not found.

getParentSessionIdFromAttribute

public static java.lang.String getParentSessionIdFromAttribute(javax.servlet.http.HttpServletRequest pRequest,
                                                               javax.servlet.http.HttpSession pSession,
                                                               boolean pCopyToRequest)
Return the parent session id of the session by fetching from the holder contains in the PARENT_SESSION_ID_ATTR session attribute.

Parameters:
pRequest - the request from which to first attempt to get the parent session id (ignored if null)
pSession - the session from which to get the parent session id (ignored if null).
pCopyToRequest - copy the parent session id to the request, if not already on the request, and present on the session.
Returns:
the parent session id, or null if not found.

getParentSessionIdFromAttribute

public static java.lang.String getParentSessionIdFromAttribute(javax.servlet.http.HttpSession pSession)
Return the parent session id of the session by fetching from the holder contains in the PARENT_SESSION_ID_ATTR session attribute.

Returns:
the parent session id, or null if not found.