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(java.lang.String path)
          Forwards to the relative path.
 java.lang.String[] getAllowedLanguages()
          Returns the allowed script languages.
 java.lang.Object getAttribute(java.lang.String name)
          Returns an attribute with the lowest score.
 java.lang.Object getAttribute(java.lang.String name, int scope)
          Returns an attribute from the given scope.
 java.lang.String[] getMethods()
          Returns the HTTP request methods allowed.
 HttpServletRequest getRequest()
          Returns the http request.
 HttpServletResponse getResponse()
          Returns the http response
 java.io.Reader getScriptSource()
          Returns a reader from the source.
 Servlet getServlet()
          Returns the servlet
 void include(java.lang.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(java.lang.String name, java.lang.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
getAttributesScope, getBindings, getErrorWriter, getReader, getScopes, getWriter, removeAttribute, setBindings, setErrorWriter, setReader, setWriter
 

Field Detail

REQUEST_SCOPE

static final int REQUEST_SCOPE
See Also:
Constant Field Values

APPLICATION_SCOPE

static final int APPLICATION_SCOPE
See Also:
Constant Field Values

SESSION_SCOPE

static final int SESSION_SCOPE
See Also:
Constant Field Values
Method Detail

initialize

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

Throws:
ServletException

release

void release()
Clears the state of the context.


getAttribute

java.lang.Object getAttribute(java.lang.String name,
                              int scope)
Returns an attribute from the given scope.

Specified by:
getAttribute in interface ScriptContext

getAttribute

java.lang.Object getAttribute(java.lang.String name)
Returns an attribute with the lowest score.

Specified by:
getAttribute in interface ScriptContext

setAttribute

void setAttribute(java.lang.String name,
                  java.lang.Object value,
                  int scope)
Sets an attribute from the given scope.

Specified by:
setAttribute in interface ScriptContext

getScriptSource

java.io.Reader getScriptSource()
Returns a reader from the source.


getRequest

HttpServletRequest getRequest()
Returns the http request.


getResponse

HttpServletResponse getResponse()
Returns the http response


getServlet

Servlet getServlet()
Returns the servlet


forward

void forward(java.lang.String path)
             throws ServletException,
                    java.io.IOException
Forwards to the relative path.

Throws:
ServletException
java.io.IOException

include

void include(java.lang.String path)
             throws ServletException,
                    java.io.IOException
Includes the relative path.

Throws:
ServletException
java.io.IOException

disableScript

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


useSession

boolean useSession()
Returns the script session state.


displayResults

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


getMethods

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


getAllowedLanguages

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