com.arsdigita.dispatcher
Class InitialRequestContext

java.lang.Object
  extended bycom.arsdigita.dispatcher.InitialRequestContext
All Implemented Interfaces:
RequestContext
Direct Known Subclasses:
KernelRequestContext

public class InitialRequestContext
extends Object
implements RequestContext

Implements a request context for the site map application or for any application dispatcher that creates the first application context for an incoming request.

Since:
4.5
Version:
ACS 4.5
Author:
Bill Schneider

Field Summary
static String versionId
           
 
Constructor Summary
  InitialRequestContext(javax.servlet.http.HttpServletRequest request, javax.servlet.ServletContext sctx)
          Constructs a new request context from the given servlet request.
protected InitialRequestContext(RequestContext that)
          Copy constructor.
 
Method Summary
 boolean getDebugging()
          Gets the debugging flag.
 boolean getDebuggingXML()
          Gets the show-XML-only flag.
 boolean getDebuggingXSL()
          Gets the show-XSL-only flag.
 Locale getLocale()
          Gets the locale for the current request context.
 String getOriginalURL()
          Gets the original URL requested by the end user's browser.
 String getOutputType()
          Gets the requested output type.
 String getPageBase()
          At this point, we're not in any specific package, so just returns '/'.
 String getProcessedURLPart()
          Returns the portion of the requested URL that was used so by far by all previous dispatchers in the chain.
 String getRemainingURLPart()
          Returns the portion of the requested URL that has not already been used by all previous dispatchers in the chain.
 ResourceBundle getResourceBundle()
          XXX Only added so that the class compiles.
 javax.servlet.ServletContext getServletContext()
          Gets the current servlet context.
protected  void setProcessedURLPart(String s)
          Sets the portion of the requested URL that has already been processed by all the previous dispatchers in the chain.
protected  void setRemainingURLPart(String s)
          Sets the portion of the requested URL that has not already been processed by any previous dispatcher in the chain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values
Constructor Detail

InitialRequestContext

protected InitialRequestContext(RequestContext that)
Copy constructor. Creates a new InitialRequestContext with identical properties as the parameter that. This is useful for deferred construction of subclass objects with the same properties.

Parameters:
that - a request context to copy basic properties from.

InitialRequestContext

public InitialRequestContext(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.ServletContext sctx)
Constructs a new request context from the given servlet request. Some initial URL portion has already been handled by the servlet container in dispatching to our web application.

Parameters:
request - the servlet request
sctx - the servlet context
Method Detail

getProcessedURLPart

public String getProcessedURLPart()
Returns the portion of the requested URL that was used so by far by all previous dispatchers in the chain.

Specified by:
getProcessedURLPart in interface RequestContext
Returns:
the portion of the requested URL that was used so by far by all previous dispatchers in the chain.

getRemainingURLPart

public String getRemainingURLPart()
Returns the portion of the requested URL that has not already been used by all previous dispatchers in the chain.

Specified by:
getRemainingURLPart in interface RequestContext
Returns:
the portion of the requested URL that has not already been used by all previous dispatchers in the chain.

setRemainingURLPart

protected void setRemainingURLPart(String s)
Sets the portion of the requested URL that has not already been processed by any previous dispatcher in the chain

Parameters:
s - the remaining unprocessed URL portion

setProcessedURLPart

protected void setProcessedURLPart(String s)
Sets the portion of the requested URL that has already been processed by all the previous dispatchers in the chain. This allows decorating subclasses like SiteNodeRequestContext to mark an additional portion of the URL as processed.

Parameters:
s - the remaining unprocessed URL portion

getOriginalURL

public String getOriginalURL()
Description copied from interface: RequestContext
Gets the original URL requested by the end user's browser. This URL does not change when a request is forwarded by the application; "/foo/bar" is still the original request URI in the browser even if we've dispatched the request to "/packages/foo/www/bar.jsp".

Specified by:
getOriginalURL in interface RequestContext
Returns:
the original URL requested by the end user's browser. All generated HREF, IMG SRC, and FORM ACTION attributes, and any redirects, will be relative to this URL.

getServletContext

public javax.servlet.ServletContext getServletContext()
Description copied from interface: RequestContext
Gets the current servlet context.

Specified by:
getServletContext in interface RequestContext
Returns:
the current servlet context, which must be set by implementation.

getPageBase

public String getPageBase()
At this point, we're not in any specific package, so just returns '/'.

Specified by:
getPageBase in interface RequestContext
Returns:
the base path, relative to the webapp root, where JSP-based resources will be found. Returns with a trailing slash (for example, /packages/package-key/www/).

getLocale

public Locale getLocale()
Description copied from interface: RequestContext
Gets the locale for the current request context.

Specified by:
getLocale in interface RequestContext
Returns:
the locale preferred by the user, as specified in the Accept-Language header.

getOutputType

public String getOutputType()
Description copied from interface: RequestContext
Gets the requested output type.

Specified by:
getOutputType in interface RequestContext
Returns:
the requested output type (normally "text/html" by default for a web browser request).

getResourceBundle

public ResourceBundle getResourceBundle()
XXX Only added so that the class compiles.

Specified by:
getResourceBundle in interface RequestContext
Returns:
the current java.util.ResourceBundle to use in this request.

getDebugging

public boolean getDebugging()
Description copied from interface: RequestContext
Gets the debugging flag.

Specified by:
getDebugging in interface RequestContext
Returns:
the debugging flag. Currently, debugging applies to XSL transformation.

getDebuggingXML

public boolean getDebuggingXML()
Description copied from interface: RequestContext
Gets the show-XML-only flag.

Specified by:
getDebuggingXML in interface RequestContext
Returns:
if true, indicates that the active PresentationManager should output raw, untransformed XML instead of processing it with XSLT.

getDebuggingXSL

public boolean getDebuggingXSL()
Description copied from interface: RequestContext
Gets the show-XSL-only flag.

Specified by:
getDebuggingXSL in interface RequestContext
Returns:
if true, indicates that the active PresentationManager should output the XSLT stylesheet in effect for this request.


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC