javax.script.http

Interface HttpScriptContext

All Superinterfaces:
ScriptContext

public interface HttpScriptContext
extends ScriptContext

Context information from an engine to the namespace.

Field Summary

static int
APPLICATION_SCOPE
static int
REQUEST_SCOPE
static int
SESSION_SCOPE

Fields inherited from interface javax.script.ScriptContext

ENGINE_SCOPE, GLOBAL_SCOPE

Method Summary

boolean
disableScript()
Returns the script enable/disable state.
boolean
displayResults()
True if the servlet should display the results.
void
forward(String path)
Forwards to the relative path.
String[]
getAllowedLanguages()
Returns the allowed script languages.
Object
getAttribute(String name)
Returns an attribute with the lowest score.
Object
getAttribute(String name, int scope)
Returns an attribute from the given scope.
String[]
getMethods()
Returns the HTTP request methods allowed.
HttpServletRequest
getRequest()
Returns the http request.
HttpServletResponse
getResponse()
Returns the http response
Reader
getScriptSource()
Returns a reader from the source.
Servlet
getServlet()
Returns the servlet
void
include(String path)
Includes the relative path.
void
initialize(Servlet servlet, HttpServletRequest request, HttpServletResponse response)
Initialize the context with the current servlet.
void
release()
Clears the state of the context.
void
setAttribute(String name, Object value, int scope)
Sets an attribute from the given scope.
boolean
useSession()
Returns the script session state.

Methods inherited from interface javax.script.ScriptContext

getAttribute, getAttribute, getAttributesScope, getBindings, getErrorWriter, getReader, getScopes, getWriter, removeAttribute, setAttribute, setBindings, setErrorWriter, setReader, setWriter

Field Details

APPLICATION_SCOPE

public static final int APPLICATION_SCOPE
Field Value:
175

REQUEST_SCOPE

public static final int REQUEST_SCOPE
Field Value:
0

SESSION_SCOPE

public static final int SESSION_SCOPE
Field Value:
150

Method Details

disableScript

public boolean disableScript()
Returns the script enable/disable state.

displayResults

public boolean displayResults()
True if the servlet should display the results.

forward

public void forward(String path)
            throws ServletException,
                   IOException
Forwards to the relative path.

getAllowedLanguages

public String[] getAllowedLanguages()
Returns the allowed script languages.

getAttribute

public Object getAttribute(String name)
Returns an attribute with the lowest score.
Specified by:
getAttribute in interface ScriptContext

getAttribute

public Object getAttribute(String name,
                           int scope)
Returns an attribute from the given scope.
Specified by:
getAttribute in interface ScriptContext

getMethods

public String[] getMethods()
Returns the HTTP request methods allowed.

getRequest

public HttpServletRequest getRequest()
Returns the http request.

getResponse

public HttpServletResponse getResponse()
Returns the http response

getScriptSource

public Reader getScriptSource()
Returns a reader from the source.

getServlet

public Servlet getServlet()
Returns the servlet

include

public void include(String path)
            throws ServletException,
                   IOException
Includes the relative path.

initialize

public void initialize(Servlet servlet,
                       HttpServletRequest request,
                       HttpServletResponse response)
            throws ServletException
Initialize the context with the current servlet.

release

public void release()
Clears the state of the context.

setAttribute

public void setAttribute(String name,
                         Object value,
                         int scope)
Sets an attribute from the given scope.
Specified by:
setAttribute in interface ScriptContext

useSession

public boolean useSession()
Returns the script session state.