WebObjects 5.2.3

Class WOServletContext

  extended bycom.webobjects.appserver.WOContext
      extended bycom.webobjects.jspservlet.WOServletContext
All Implemented Interfaces:
Cloneable, NSKeyValueCoding, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions

public class WOServletContext
extends WOContext
implements Cloneable

Subclass of WOContext providing custom URL generation, to account for JSP Session IDs. This class is expected to be created at the appropriate time by calling the new setContextClassName API on WOApplication. No change is necessary for most applications, unless WOApplication.createContextForRequest has been overridden to not call super(). If that is the case, you should subclass WOServletContext for your custom WOContext.

Nested Class Summary
Nested classes inherited from class com.webobjects.foundation.NSKeyValueCoding
NSKeyValueCoding.DefaultImplementation, NSKeyValueCoding.ErrorHandling, NSKeyValueCoding.Null, NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.Utility, NSKeyValueCoding.ValueAccessor
Nested classes inherited from class com.webobjects.foundation.NSKeyValueCodingAdditions
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility
Field Summary
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
Constructor Summary
WOServletContext(WORequest aRequest)
          Creates a new WOServletContext object with aRequest.
Method Summary
 javax.servlet.http.HttpServletRequest httpServletRequest()
          Returns the HttpServletRequest.
 javax.servlet.http.HttpServletResponse httpServletResponse()
          Returns the HttpServletResponse.
 javax.servlet.http.HttpSession httpSession()
          Returns the HttpSession, if it exists.
 Object jspPage()
          Returns the JSP page object that was part of the PageContext.
 javax.servlet.jsp.JspWriter jspWriter()
          Returns the JspWriter that was part of the PageContext.
 javax.servlet.ServletConfig servletConfig()
          Returns the ServletConfig.
 javax.servlet.ServletContext servletContext()
          Returns the ServletContext.
 WOSession session()
          Returns the object representing the receiving context's session, if one exists.
Methods inherited from class com.webobjects.appserver.WOContext
appendElementIDComponent, appendZeroElementIDComponent, canAccessFieldsDirectly, clone, completeURLWithRequestHandlerKey, component, componentActionURL, contextID, contextWithRequest, deleteAllElementIDComponents, deleteLastElementIDComponent, directActionURLForActionNamed, elementID, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hasSession, incrementLastElementIDComponent, isInForm, page, request, response, senderID, setInForm, takeValueForKey, takeValueForKeyPath, toString, unableToSetNullForKey, urlWithRequestHandlerKey, valueForKey, valueForKeyPath
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public WOServletContext(WORequest aRequest)
Creates a new WOServletContext object with aRequest. The userInfo dictionary of aRequest should contain at least the following: HttpServletRequest, HttpServletResponse ServletConfig, ServletContext. Optionally (for JSP pages), PageContext should also be included. The keys for the above objects are the same as the class of object. If PageContext is included, the JSP page and JspWriter objects will be extracted from the PageContext.

aRequest - the WORequest the context should be created for
Method Detail


public javax.servlet.http.HttpServletRequest httpServletRequest()
Returns the HttpServletRequest.

HttpServletRequest the HttpServletRequest


public javax.servlet.http.HttpServletResponse httpServletResponse()
Returns the HttpServletResponse.

HttpServletResponse the HttpServletResponse


public javax.servlet.http.HttpSession httpSession()
Returns the HttpSession, if it exists. Returns null otherwise.

HttpSession the JSP/Servlet session


public Object jspPage()
Returns the JSP page object that was part of the PageContext. Only relevant for requests coming from JSP pages.

Object the page object extracted from the PageContext


public javax.servlet.jsp.JspWriter jspWriter()
Returns the JspWriter that was part of the PageContext. Only relevant for requests coming from JSP pages.

JspWriter the JspWriter extracted from the PageContext


public javax.servlet.ServletConfig servletConfig()
Returns the ServletConfig.

ServletConfig the ServletConfig


public javax.servlet.ServletContext servletContext()
Returns the ServletContext.

ServletContext the ServletContext


public WOSession session()
Returns the object representing the receiving context's session, if one exists. The overriden method checks to see if the session is part of the JSP session. If that fails, it defaults to the superclass behavior.

session in class WOContext
the object representing the receiving context's session
See Also:
WOContext.component(), WOContext.page(), WOContext.request(), WOContext.response(), WOContext.hasSession(), WOSession, WOApplication.createSessionForRequest(WORequest request)

Last updated Thu Oct 21 15:04:16 PDT 2004.

Copyright © 2004 Apple Computer, Inc.