|
WebObjects 5.4.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.webobjects.jspservlet.WOServletAdaptor
public class WOServletAdaptor
Nested Class Summary | |
---|---|
static class |
WOServletAdaptor.JavaArchiveFilter
|
Constructor Summary | |
---|---|
WOServletAdaptor()
Empty default constructor that just calls super(). |
Method Summary | |
---|---|
void |
destroy()
|
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,
Map bindings,
Map 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,
Map bindings,
Map extraHeaders,
javax.servlet.jsp.PageContext pageContext,
boolean bodyContentOnly,
boolean mergeResponseHeaders)
|
static String |
embeddedDirectActionResponse(String actionName,
String className,
Map formValues,
InputStream contentStream,
Map 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,
Map formValues,
InputStream contentStream,
Map 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 |
---|
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
javax.servlet.ServletException
Method Detail |
---|
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 static Object woApplicationObject()
initStatics
, embeddedComponentResponse
, embeddedDirectActionResponse
, or a Taglib must have been invoked previous to calling this.
protected static String embeddedComponentResponse(String name, Map bindings, Map extraHeaders, javax.servlet.jsp.PageContext pageContext, boolean bodyContentOnly, boolean mergeResponseHeaders)
public static String embeddedComponentResponse(String name, Map bindings, Map 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, Map formValues, InputStream contentStream, Map extraHeaders, javax.servlet.jsp.PageContext pageContext, boolean bodyContentOnly, boolean mergeResponseHeaders)
public static String embeddedDirectActionResponse(String actionName, String className, Map formValues, InputStream contentStream, Map 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
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
public void destroy()
destroy
in interface javax.servlet.Servlet
destroy
in class javax.servlet.GenericServlet
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.
doPost
in class javax.servlet.http.HttpServlet
request
- the HttpServletRequestresponse
- the HttpServletResponse
IOException
javax.servlet.ServletException
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.
doGet
in class javax.servlet.http.HttpServlet
request
- the HttpServletRequestresponse
- the HttpServletResponse
IOException
javax.servlet.ServletException
public String toString()
classpath
, the mainBundlePath
, the name of the WOApplication subclass, as well as the ServletConfig and ServletContext
toString
in class Object
|
Last updated June 2008 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |