| |
|
| java.lang.Object javax.servlet.GenericServlet javax.script.http.HttpScriptServlet
HttpScriptServlet | abstract public class HttpScriptServlet extends GenericServlet (Code) | | A HttpScriptServlet uses a ScriptEngine supplied by
calling its getEngine method to execute a script in a
HttpScriptContext returned by its getContext method.
|
Method Summary | |
abstract public HttpScriptContext | getContext(HttpServletRequest req, HttpServletResponse res) Returns a HttpScriptContext initialized using the specified
HttpServletRequest , HttpServletResponse and a
reference to this HttpScriptServlet
Parameters: req - The specified HttpServletRequest . Parameters: res - The specified HttpServletResponse . | abstract public ScriptEngine | getEngine(HttpServletRequest request) Returns a ScriptEngine that is used by the HttpScriptServlet
to execute a single request.
The implementation must ensure that if the same engine is used to service
requests concurrently on multiple threads that side-effects of script execution
on any thread will not be visible in the engine scopes of other threads. | abstract public void | releaseEngine(ScriptEngine engine) Called to indicate that a ScriptEngine retruned by a call to
getEngine is no longer in use. | public void | service(ServletRequest req, ServletResponse res) Executes a request using the HttpScriptContext returned by
getContext and the ScriptEngine returned by
getEngine .
A default implementation is provided:
Parameters: req - The current request. |
getEngine | abstract public ScriptEngine getEngine(HttpServletRequest request)(Code) | | Returns a ScriptEngine that is used by the HttpScriptServlet
to execute a single request.
The implementation must ensure that if the same engine is used to service
requests concurrently on multiple threads that side-effects of script execution
on any thread will not be visible in the engine scopes of other threads. This
will be the case if the returned ScriptEngine implements a class
associated with a ScriptEngineInfo where either
getParameter("THREAD-ISOLATED") or getParameter("STATELESS") returns
java.lang.Boolean.TRUE .
Parameters: request - The current request. The ScriptEngine used by this HttpScriptServlet toexecute requests. |
releaseEngine | abstract public void releaseEngine(ScriptEngine engine)(Code) | | Called to indicate that a ScriptEngine retruned by a call to
getEngine is no longer in use.
Parameters: engine - The ScriptEngine |
service | public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException(Code) | | Executes a request using the HttpScriptContext returned by
getContext and the ScriptEngine returned by
getEngine .
A default implementation is provided:
Parameters: req - The current request. Must be an instance of HttpServletRequest . Parameters: res - The current response. Must be an instance of HttpServletResponse . throws: IllegalArgumentException - If either req is not an instance of HttpServletRequest or res is not an instance of HttpServletResponse throws: ServletException - throws: IOException - |
|
|
|