|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface HttpScriptContext
HttpScriptContext is a subinteface of ScriptContext which is used to connect a ScriptEngine and implicit objects form a servlet container to for a single request.
Field Summary | |
---|---|
static int |
APPLICATION_SCOPE
Integer value for the level of APPLICATION_SCOPE |
static int |
REQUEST_SCOPE
Integer value for the level of SCRIPT_SCOPE |
static int |
SESSION_SCOPE
Integer value for the level of SESSION_SCOPE |
Fields inherited from interface javax.script.ScriptContext |
---|
ENGINE_SCOPE, GLOBAL_SCOPE |
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 name)
Retrieves the value for the specified key in the lowest scope in which the key is defined. |
java.lang.Object |
getAttribute(java.lang.String name,
int scope)
Retrieves the value associated with the specified key in specified level of 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. |
void |
include(java.lang.String relativePath)
Includes the resource in the sepcified relative path. |
void |
initialize(javax.servlet.Servlet servlet,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
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 name,
java.lang.Object value,
int scope)
Sets the value for the specified key in the 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 interface javax.script.ScriptContext |
---|
getAttributesScope, getBindings, getErrorWriter, getReader, getScopes, getWriter, removeAttribute, setBindings, setErrorWriter, setReader, setWriter |
Field Detail |
---|
static final int REQUEST_SCOPE
static final int SESSION_SCOPE
static final int APPLICATION_SCOPE
Method Detail |
---|
boolean disableScript()
boolean displayResults()
void forward(java.lang.String relativePath) throws javax.servlet.ServletException, java.io.IOException
relativePath
- the URI to process the request
java.io.IOException
- if an input or output error occurs while
processing the HTTP request
javax.servlet.ServletException
- if the HTTP cannot be handledjava.lang.String[] getAllowedLanguages()
java.lang.Object getAttribute(java.lang.String name)
getAttribute
in interface ScriptContext
name
- the name of the value to be retrieved
java.lang.Object getAttribute(java.lang.String name, int scope) throws java.lang.IllegalArgumentException
getAttribute
in interface ScriptContext
scope
- the integer value of level of scopename
- the name of the attribute
java.lang.IllegalArgumentException
- if name is null or the scope
is invalidjava.lang.String[] getMethods()
javax.servlet.http.HttpServletRequest getRequest()
javax.servlet.http.HttpServletResponse getResponse()
java.io.Reader getScriptSource()
javax.servlet.Servlet getServlet()
void include(java.lang.String relativePath) throws java.io.IOException, javax.servlet.ServletException
relativePath
- the URI of the request to be processed
java.io.IOException
- if an input or output error occurs while
processing the HTTP request
javax.servlet.ServletException
- if the servlet cannot handled the
HTTP requestvoid initialize(javax.servlet.Servlet servlet, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException
servlet
- the HttpServlet which execute the requestreq
- the current requestres
- the current response
javax.servlet.ServletException
- if the servlet cannot handle the HTTP
requestvoid release()
void setAttribute(java.lang.String name, java.lang.Object value, int scope)
setAttribute
in interface ScriptContext
name
- the key associated with the specified valuevalue
- the value associated with the specified keyscope
- the level of scope
java.lang.IllegalArgumentException
- if the level of scope is
invalid
java.lang.IllegalStateException
- if the session is either invalid
or diabledboolean useSession()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |