|
||||||||||
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 String[] |
defaultMethods
|
protected boolean |
disableScript
|
protected boolean |
displayResults
|
protected String[] |
languages
|
protected String[] |
methods
|
protected javax.servlet.http.HttpServletRequest |
request
|
protected javax.servlet.http.HttpServletResponse |
response
|
protected String |
scriptDir
|
protected javax.servlet.Servlet |
servlet
|
protected boolean |
useSession
|
Fields inherited from class javax.script.SimpleScriptContext |
---|
engineScope, errorWriter, globalScope, reader, writer |
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(String relativePath)
Forwards the request to the resource identified by the specified relative path. |
String[] |
getAllowedLanguages()
Retrieves an array of Strings describing the languages that may be used by scripts which is running in the associated HttpScriptContext. |
Object |
getAttribute(String key,
Object value,
int scope)
|
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. |
Reader |
getScriptSource()
Retrieves a reader form which the executing script can be read. |
javax.servlet.Servlet |
getServlet()
Retrieves the associated HttpScriptServlet. |
Writer |
getWriter()
Retrieves an instance of java.io.Writer which can be used by scripts to display their output. |
void |
include(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(String key,
Object value,
int scope)
Associates a specified value with the specifed name in the specified 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 javax.script.ScriptContext |
---|
getAttribute, getAttribute, getAttributesScope, getBindings, getErrorWriter, getReader, getScopes, removeAttribute, setBindings, setErrorWriter, setReader, setWriter |
Field Detail |
---|
public static final String[] defaultMethods
protected boolean disableScript
protected boolean displayResults
protected String scriptDir
protected String[] languages
protected 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 String[] getAllowedLanguages()
HttpScriptContext
getAllowedLanguages
in interface HttpScriptContext
public Object getAttribute(String key, Object value, int scope)
public void setAttribute(String key, Object value, int scope) throws IllegalArgumentException
SimpleScriptContext
setAttribute
in interface ScriptContext
setAttribute
in class SimpleScriptContext
key
- the name of the attributevalue
- the value of the attributescope
- the scope
IllegalArgumentException
- if the name is null or the
scope is invalidpublic void forward(String relativePath) throws javax.servlet.ServletException, IOException
HttpScriptContext
forward
in interface HttpScriptContext
relativePath
- the URI to process the request
javax.servlet.ServletException
- if the HTTP cannot be handled
IOException
- if an input or output error occurs while
processing the HTTP requestpublic 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 Reader getScriptSource()
HttpScriptContext
getScriptSource
in interface HttpScriptContext
public javax.servlet.Servlet getServlet()
HttpScriptContext
getServlet
in interface HttpScriptContext
public void include(String relativePath) throws javax.servlet.ServletException, 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
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 Writer getWriter()
SimpleScriptContext
getWriter
in interface ScriptContext
getWriter
in class SimpleScriptContext
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |