|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.script.SimpleScriptContext
org.apache.bsf.utils.http.GenericHttpScriptContext
public class GenericHttpScriptContext
Field Summary | |
---|---|
static java.lang.String[] |
defaultMethods
|
protected boolean |
disableScript
|
protected boolean |
displayResults
|
protected java.lang.String[] |
languages
|
protected java.lang.String[] |
methods
|
protected javax.servlet.http.HttpServletRequest |
request
|
protected javax.servlet.http.HttpServletResponse |
response
|
protected java.lang.String |
scriptDir
|
protected javax.servlet.Servlet |
servlet
|
protected boolean |
useSession
|
Fields inherited from class javax.script.SimpleScriptContext |
---|
engineScope, globalScope |
Fields inherited from interface org.apache.bsf.utils.http.HttpScriptContext |
---|
APPLICATION_SCOPE, REQUEST_SCOPE, SESSION_SCOPE |
Fields inherited from interface javax.script.ScriptContext |
---|
ENGINE_SCOPE, GLOBAL_SCOPE |
Constructor Summary | |
---|---|
GenericHttpScriptContext()
|
Method Summary | |
---|---|
boolean |
disableScript()
Retrieves a boolean value which indicates whether the script execution has been disabled in the Web Application. |
boolean |
displayResults()
Retrieves a boolean value which indicates whether the HttpScriptServlet executing in this context should display the results of script evaluations. |
void |
forward(java.lang.String relativePath)
Forwards the request to the resource identified by the specified relative path. |
java.lang.String[] |
getAllowedLanguages()
Retrieves an array of Strings describing the languages that may be used by scripts which is running in the associated HttpScriptContext. |
java.lang.Object |
getAttribute(java.lang.String key,
java.lang.Object value,
int scope)
|
java.lang.String[] |
getMethods()
Retrieves an array of string describing HTTP request methods which are handled by servlets executing in current context. |
javax.servlet.http.HttpServletRequest |
getRequest()
Retrieves a HttpScriptRequest for the current request. |
javax.servlet.http.HttpServletResponse |
getResponse()
Retrieves a HttpScriptResponse for the current request. |
java.io.Reader |
getScriptSource()
Retrieves a reader form which the executing script can be read. |
javax.servlet.Servlet |
getServlet()
Retrieves the associated HttpScriptServlet. |
java.io.Writer |
getWriter()
Retrieves an instance of java.io.Writer which can be used by scripts to display their output. |
void |
include(java.lang.String relativePath)
Includes the resource in the sepcified relative path. |
void |
initialize(javax.servlet.Servlet servlet,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Initialize the current HttpScriptContext for processing of single request. |
void |
release()
Clears any state stored in the current HttpScriptContext such that it can be reused to serve another request. |
void |
setAttribute(java.lang.String key,
java.lang.Object value,
int scope)
Sets an attribute specified by the name in specified level of scope. |
boolean |
useSession()
Retrieves a boolean value which indicates whether the HttpSession associated with the current request is exposed in SESSION_SCOPE attribute and in the HttpScriptRequest. |
Methods inherited from class javax.script.SimpleScriptContext |
---|
getAttribute, getAttribute, getAttributesScope, getBindings, getErrorWriter, getReader, getScopes, removeAttribute, setBindings, setErrorWriter, setReader, setWriter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.bsf.utils.http.HttpScriptContext |
---|
getAttribute, getAttribute |
Methods inherited from interface javax.script.ScriptContext |
---|
getAttributesScope, getBindings, getErrorWriter, getReader, getScopes, removeAttribute, setBindings, setErrorWriter, setReader, setWriter |
Field Detail |
---|
public static final java.lang.String[] defaultMethods
protected boolean disableScript
protected boolean displayResults
protected java.lang.String scriptDir
protected java.lang.String[] languages
protected java.lang.String[] methods
protected javax.servlet.http.HttpServletRequest request
protected javax.servlet.http.HttpServletResponse response
protected javax.servlet.Servlet servlet
protected boolean useSession
Constructor Detail |
---|
public GenericHttpScriptContext()
Method Detail |
---|
public boolean disableScript()
HttpScriptContext
disableScript
in interface HttpScriptContext
public boolean displayResults()
HttpScriptContext
displayResults
in interface HttpScriptContext
public java.lang.String[] getAllowedLanguages()
HttpScriptContext
getAllowedLanguages
in interface HttpScriptContext
public java.lang.Object getAttribute(java.lang.String key, java.lang.Object value, int scope)
public void setAttribute(java.lang.String key, java.lang.Object value, int scope) throws java.lang.IllegalArgumentException
SimpleScriptContext
setAttribute
in interface ScriptContext
setAttribute
in interface HttpScriptContext
setAttribute
in class SimpleScriptContext
key
- the name of the attributevalue
- the value of the attributescope
- the level of the scope
java.lang.IllegalArgumentException
- if the name is null or the
scope is invalidpublic void forward(java.lang.String relativePath) throws javax.servlet.ServletException, java.io.IOException
HttpScriptContext
forward
in interface HttpScriptContext
relativePath
- the URI to process the request
javax.servlet.ServletException
- if the HTTP cannot be handled
java.io.IOException
- if an input or output error occurs while
processing the HTTP requestpublic java.lang.String[] getMethods()
HttpScriptContext
getMethods
in interface HttpScriptContext
public javax.servlet.http.HttpServletRequest getRequest()
HttpScriptContext
getRequest
in interface HttpScriptContext
public javax.servlet.http.HttpServletResponse getResponse()
HttpScriptContext
getResponse
in interface HttpScriptContext
public java.io.Reader getScriptSource()
HttpScriptContext
getScriptSource
in interface HttpScriptContext
public javax.servlet.Servlet getServlet()
HttpScriptContext
getServlet
in interface HttpScriptContext
public void include(java.lang.String relativePath) throws javax.servlet.ServletException, java.io.IOException
HttpScriptContext
include
in interface HttpScriptContext
relativePath
- the URI of the request to be processed
javax.servlet.ServletException
- if the servlet cannot handled the
HTTP request
java.io.IOException
- if an input or output error occurs while
processing the HTTP requestpublic void initialize(javax.servlet.Servlet servlet, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException
HttpScriptContext
initialize
in interface HttpScriptContext
servlet
- the HttpServlet which execute the requestrequest
- the current requestresponse
- the current response
javax.servlet.ServletException
- if the servlet cannot handle the HTTP
requestpublic void release()
HttpScriptContext
release
in interface HttpScriptContext
public boolean useSession()
HttpScriptContext
useSession
in interface HttpScriptContext
public java.io.Writer getWriter()
ScriptContext
getWriter
in interface ScriptContext
getWriter
in class SimpleScriptContext
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |