Skip navigation links

Oracle® Fusion Middleware Site Studio for External Applications Java API Reference
11g Release 1 (11.1.1)

E17273-01


oracle.stellent.wcm.javaee.utils
Class ServletHelper

java.lang.Object
  extended by oracle.stellent.wcm.javaee.utils.ServletHelper


public abstract class ServletHelper
extends java.lang.Object

Helper methods for working with servlet objects in the WCM environment.


Nested Class Summary
static class ServletHelper.ModeAndPath
           

 

Field Summary
static java.lang.String JAVAX_FORWARD_PATH_INFO
           
static java.lang.String JAVAX_FORWARD_REQUEST_URI
           
static java.lang.String JAVAX_FORWARD_SERVLET_PATH
           
static java.lang.String JAVAX_INCLUDE_PATH_INFO
           
static java.lang.String JAVAX_INCLUDE_REQUEST_URI
           
static java.lang.String JAVAX_INCLUDE_SERVLET_PATH
           
protected static ILog s_log
           

 

Constructor Summary
ServletHelper()
           

 

Method Summary
static javax.servlet.http.Cookie getCookie(javax.servlet.ServletRequest request, java.lang.String cookieName)
          Retrieve the cookie
static oracle.stellent.ridc.IdcContext getIdentity(javax.servlet.ServletRequest request)
          Retrieve the identity on this request
static int getJspScope(java.lang.String name)
          Convert from the scope name to the int value
static ServletHelper.ModeAndPath getModeAndPath(javax.servlet.http.HttpServletRequest request, java.lang.String path)
          Determine the mode from the current path
static java.lang.String getOriginalRequestPath(javax.servlet.http.HttpServletRequest servletRequest)
          Retrieve the original request path (i.e.
static java.util.Map<java.lang.String,java.lang.String> getParameterMap(javax.servlet.http.HttpServletRequest request)
          Obtain a mapping of parameter name to values from the given request.
static java.lang.String getPreviewFromCookie(javax.servlet.ServletRequest request)
          Retrieve the designer mode from the cookie on the given request
static java.lang.String getRequestPath(javax.servlet.http.HttpServletRequest servletRequest)
           
static java.lang.String getServletContext(javax.servlet.http.HttpServletRequest request, boolean includeRequestContext)
          Retrieve the servlet context path when rendering a JSP; looks to see if this page was included by another web resource
static void initializeApplication(javax.servlet.ServletContext servletContext)
          Initialize the application enviroment
static boolean isContributorModeFromCookie(javax.servlet.ServletRequest request)
          Retrieve the site mode from the cookie on the given request
static boolean isDesignerFromCookie(javax.servlet.ServletRequest request)
          Retrieve the designer mode from the cookie on the given request
static boolean isMultipartPost(javax.servlet.http.HttpServletRequest request)
          Determine if the request is a multipart post

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

JAVAX_FORWARD_REQUEST_URI

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

JAVAX_FORWARD_SERVLET_PATH

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

JAVAX_FORWARD_PATH_INFO

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

JAVAX_INCLUDE_REQUEST_URI

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

JAVAX_INCLUDE_SERVLET_PATH

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

JAVAX_INCLUDE_PATH_INFO

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

s_log

protected static ILog s_log

Constructor Detail

ServletHelper

public ServletHelper()

Method Detail

getModeAndPath

public static ServletHelper.ModeAndPath getModeAndPath(javax.servlet.http.HttpServletRequest request,
                                                       java.lang.String path)
Determine the mode from the current path
Parameters:
request - the http servlet request
path - the path
Returns:
the mode

getJspScope

public static int getJspScope(java.lang.String name)
Convert from the scope name to the int value
Parameters:
name - the scope name (page, request, session or application)
Returns:
the int value; returns PageContext.PAGE_SCOPE if no match is made

isContributorModeFromCookie

public static boolean isContributorModeFromCookie(javax.servlet.ServletRequest request)
Retrieve the site mode from the cookie on the given request
Parameters:
request - the current request
Returns:
true if the site is in contributor mode, false otherwise

isDesignerFromCookie

public static boolean isDesignerFromCookie(javax.servlet.ServletRequest request)
Retrieve the designer mode from the cookie on the given request
Parameters:
request - the current request
Returns:
true if the site is in contributor mode, false otherwise

getPreviewFromCookie

public static java.lang.String getPreviewFromCookie(javax.servlet.ServletRequest request)
Retrieve the designer mode from the cookie on the given request
Parameters:
request - the current request
Returns:
true if the site is in contributor mode, false otherwise

getCookie

public static javax.servlet.http.Cookie getCookie(javax.servlet.ServletRequest request,
                                                  java.lang.String cookieName)
Retrieve the cookie
Parameters:
request - the request
cookieName - the name of the cookie
Returns:
the cookie or null if not found

initializeApplication

public static void initializeApplication(javax.servlet.ServletContext servletContext)
                                  throws javax.servlet.ServletException
Initialize the application enviroment
Parameters:
servletContext - the servlet context to initialize
Throws:
javax.servlet.ServletException

getIdentity

public static oracle.stellent.ridc.IdcContext getIdentity(javax.servlet.ServletRequest request)
Retrieve the identity on this request
Parameters:
request - the request to query
Returns:
the identity

getRequestPath

public static java.lang.String getRequestPath(javax.servlet.http.HttpServletRequest servletRequest)
Parameters:
servletRequest - the servlet request
Returns:
the site path

getOriginalRequestPath

public static java.lang.String getOriginalRequestPath(javax.servlet.http.HttpServletRequest servletRequest)
Retrieve the original request path (i.e. the request path of the item that included/forwarded this request)
Parameters:
servletRequest - the servlet request
Returns:
the site path

getParameterMap

public static java.util.Map<java.lang.String,java.lang.String> getParameterMap(javax.servlet.http.HttpServletRequest request)
Obtain a mapping of parameter name to values from the given request.
Parameters:
request - the request
Returns:
a mapping of parameter name to parameter value

getServletContext

public static java.lang.String getServletContext(javax.servlet.http.HttpServletRequest request,
                                                 boolean includeRequestContext)
Retrieve the servlet context path when rendering a JSP; looks to see if this page was included by another web resource
Parameters:
request - the servlet request
includeRequestContext - true to include the request context
Returns:
the context path

isMultipartPost

public static boolean isMultipartPost(javax.servlet.http.HttpServletRequest request)
Determine if the request is a multipart post
Parameters:
request - the current request
Returns:
true if this is a multipart post

Skip navigation links

Oracle® Fusion Middleware Site Studio for External Applications Java API Reference
11g Release 1 (11.1.1)

E17273-01


Copyright © 2010, Oracle and/or its affiliates. All rights reserved.