|
WebObjects 5.2.3 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.GenericServlet javax.servlet.http.HttpServlet com.webobjects.jspservlet.WOServletAdaptor
This class
is an adaptor that allows a WebObjects application to appear as a
servlet to a servlet container, using the normal doGet/Post methods.
This is not a subclass of WOAdaptor. Nor does it participate
in the normal WOAdaptor registration/unregistration/request handling.
Instead, it is a subclass of HttpServlet. This class is not intended to be subclassed.
It also provides the static APIs embeddedComponentResponse
and embeddedDirectActionResponse
which, combined with the provided
taglib, allows JSP developers to embed WOComponents and Direct Actions
in their pages. embeddedComponentResponse
and embeddedDirectActionResponse
may also be used directly from a Servlet.
Nested Class Summary | |
static class |
WOServletAdaptor.JavaArchiveFilter
|
Constructor Summary | |
WOServletAdaptor()
Empty default constructor that just calls super(). |
Method Summary | |
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Method for GET requests. |
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Method for POST requests. |
static String |
embeddedComponentResponse(String name,
HashMap bindings,
HashMap extraHeaders,
javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse servletResponse,
javax.servlet.http.HttpServlet servlet,
boolean bodyContentOnly,
boolean mergeResponseHeaders)
Returns a String representing the generated content for a given WOComponent with name. |
protected static String |
embeddedComponentResponse(String name,
HashMap bindings,
HashMap extraHeaders,
javax.servlet.jsp.PageContext pageContext,
boolean bodyContentOnly,
boolean mergeResponseHeaders)
|
static String |
embeddedDirectActionResponse(String actionName,
String className,
HashMap formValues,
InputStream contentStream,
HashMap extraHeaders,
javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse servletResponse,
javax.servlet.http.HttpServlet servlet,
boolean bodyContentOnly,
boolean mergeResponseHeaders)
Returns a String representing the generated content for a given direct action with actionName. |
protected static String |
embeddedDirectActionResponse(String actionName,
String className,
HashMap formValues,
InputStream contentStream,
HashMap extraHeaders,
javax.servlet.jsp.PageContext pageContext,
boolean bodyContentOnly,
boolean mergeResponseHeaders)
|
void |
init()
Default init method that just calls initStatics |
static void |
initStatics(javax.servlet.ServletContext servletContext)
Initializes all the appropriate objects so that JSP/Servlet integration works. |
String |
toString()
String representation of this class, which includes the classpath , the mainBundlePath ,
the name of the WOApplication subclass, as well as the ServletConfig and ServletContext |
static Object |
woApplicationObject()
Returns the WOApplication class (or subclass) used by this application. |
Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public WOServletAdaptor() throws javax.servlet.ServletException
Method Detail |
public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
request
will be parsed
and translated into a WORequest, and handed off to the
WOApplication object. The WOResponse from the WOApplication
will be parsed and translated into the HttpServletResponse
.
This, along with doPost, allows a WOApp to run inside of a
Servlet container unchanged.
request
- the HttpServletRequestresponse
- the HttpServletResponse
IOException
javax.servlet.ServletException
public void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
request
will be parsed
and translated into a WORequest, and handed off to the
WOApplication object. The WOResponse from the WOApplication
will be parsed and translated into the HttpServletResponse
.
This, along with doGet, allows a WOApp to run inside of a
Servlet container unchanged.
request
- the HttpServletRequestresponse
- the HttpServletResponse
IOException
javax.servlet.ServletException
protected static String embeddedComponentResponse(String name, HashMap bindings, HashMap extraHeaders, javax.servlet.jsp.PageContext pageContext, boolean bodyContentOnly, boolean mergeResponseHeaders)
public static String embeddedComponentResponse(String name, HashMap bindings, HashMap extraHeaders, javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse, javax.servlet.http.HttpServlet servlet, boolean bodyContentOnly, boolean mergeResponseHeaders)
servletRequest
,
servletResponse
and servlet are passed in for possible use later. If bodyContentOnly
is
true
, only text between the first tag and the last tag will be returned.
If mergeResponseHeaders
is true
, the response headers for the WOComponent will be merged
into the servletResponse
. Note that all the servlet objects will be stored in the userInfo
dictionary argument of WOApplication.responseForComponentWithName
.
This API is designed to be invoked from inside a Servlet -- for embedding components within
JSP pages, use the taglib instead.
name
- the name of the WOComponent that should generate the response.bindings
- the bindings for the WOComponent; they can be any type of object.extraHeaders
- extra headers to merge into the WORequest as the WOComponent will see it (optional)servletRequest
- the request object as seen by the invoking ServletservletResponse
- the response object as seen by the invoking Servletservlet
- the invoking servlet itselfbodyContentOnly
- whether to extract the content of the response for returnmergeResponseHeaders
- whether to merge the WOResponse headers into servletResponse
protected static String embeddedDirectActionResponse(String actionName, String className, HashMap formValues, InputStream contentStream, HashMap extraHeaders, javax.servlet.jsp.PageContext pageContext, boolean bodyContentOnly, boolean mergeResponseHeaders)
public static String embeddedDirectActionResponse(String actionName, String className, HashMap formValues, InputStream contentStream, HashMap extraHeaders, javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse, javax.servlet.http.HttpServlet servlet, boolean bodyContentOnly, boolean mergeResponseHeaders)
className
may be specified as well, but is optional.
formValues
are passed to the direct action as a query string, while the contentString
is just passed as regular content -- if the content requires special headers to process
use extraHeaders
. extraHeaders
are headers that will be added to the WORequest as
seen by the Direct Action -- note that all the headers that are part of the
HttpServletRequest are included automatically. The servletRequest
,
servletResponse
and servlet
are passed in for possible use later. If bodyContentOnly
is
true
, only text between the first BODY tag and the last BODY tag will be returned.
If mergeResponseHeaders
is true
, the response headers for the WOComponent will be merged
into the servletResponse
. Note that all the servlet objects will be stored in the userInfo
dictionary argument of WOApplication.responseForComponentWithName
.
This API is designed to be invoked from inside a Servlet -- for embedding direct actions within
JSP pages, use the taglib instead.
actionName
- the name of the direct action that should generate the response.className
- the name of the class that the direct action is in (optional)formValues
- the formValues to pass to the direct action, passed as a queryString (optional)contentStream
- the content to pass to the direct action (optional)extraHeaders
- extra headers to merge into the WORequest as the direct action will see it (optional)servletRequest
- the request object as seen by the invoking ServletservletResponse
- the response object as seen by the invoking Servletservlet
- the invoking servlet itselfbodyContentOnly
- whether to extract the content of the response for returnmergeResponseHeaders
- whether to merge the WOResponse headers into servletResponse
public void init() throws javax.servlet.ServletException
javax.servlet.ServletException
public static void initStatics(javax.servlet.ServletContext servletContext) throws javax.servlet.UnavailableException
embeddedComponentResponse
or having the servlet container initialize
the WOServletAdaptor object will do everything for you. However, if you are
planning on using WebObjects objects directly in either a JSP or Servlet, you
must invoke this method first. Further invocations of this method past the first
will do nothing.
javax.servlet.UnavailableException
public String toString()
classpath
, the mainBundlePath
,
the name of the WOApplication subclass, as well as the ServletConfig and ServletContext
public static Object woApplicationObject()
initStatics
, embeddedComponentResponse
, embeddedDirectActionResponse
,
or a Taglib must have been invoked previous to calling this.
|
Last updated Thu Oct 21 15:04:16 PDT 2004. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |