|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.script.SimpleScriptContext
php.java.script.AbstractPhpScriptContext
php.java.script.servlet.PhpSimpleHttpScriptContext
public class PhpSimpleHttpScriptContext
A simple ScriptContext which can be used in servlet environments.
| Field Summary |
|---|
| Fields inherited from class php.java.script.AbstractPhpScriptContext |
|---|
APPLICATION_SCOPE, REQUEST_SCOPE, SESSION_SCOPE |
| Fields inherited from interface php.java.bridge.http.IContext |
|---|
ENGINE_SCOPE, GLOBAL_SCOPE, JAVA_BRIDGE, SERVLET, SERVLET_CONFIG, SERVLET_CONTEXT, SERVLET_REQUEST, SERVLET_RESPONSE |
| Fields inherited from interface javax.script.ScriptContext |
|---|
ENGINE_SCOPE, GLOBAL_SCOPE |
| Constructor Summary | |
|---|---|
PhpSimpleHttpScriptContext()
|
|
| Method Summary | |
|---|---|
java.lang.Object |
getAttribute(java.lang.String name)
Retrieves the value for getAttribute(String, int) for the lowest scope in which it returns a non-null value. |
java.lang.Object |
getAttribute(java.lang.String key,
int scope)
Retrieves the value associated with specified name in the specified level of scope. |
javax.servlet.ServletContext |
getContext()
Get the ServletContext |
java.io.Writer |
getErrorWriter()
Returns the Writer used to display error output. |
java.lang.Object |
getHttpServletRequest()
Return the http servlet request |
java.lang.Object |
getHttpServletResponse()
Return the http servlet response |
java.io.Reader |
getReader()
Returns a Reader to be used by the script to read
input. |
java.lang.String |
getRealPath(java.lang.String path)
Get the full file system path for the given resource. |
javax.servlet.http.HttpServletRequest |
getRequest()
Get the HttpServletRequest |
javax.servlet.http.HttpServletResponse |
getResponse()
Get the servlet response |
java.lang.Object |
getServlet()
Return the http servlet |
java.lang.Object |
getServletConfig()
Return the servlet config |
java.lang.Object |
getServletContext()
Return the servlet context |
java.io.Writer |
getWriter()
Returns the Writer for scripts to use when displaying output. |
java.lang.Object |
init(java.lang.Object callable)
Initialize a library. |
void |
initialize(javax.servlet.Servlet servlet,
javax.servlet.ServletContext ctx,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Initialize the context. |
void |
onShutdown(java.lang.Object closeable)
Register a shutdown hook for the library. |
void |
setAttribute(java.lang.String key,
java.lang.Object value,
int scope)
Sets an attribute specified by the name in specified level of scope. |
| Methods inherited from class php.java.script.AbstractPhpScriptContext |
|---|
call, getContinuation, setContinuation, setErrorWriter, setWriter |
| Methods inherited from class javax.script.SimpleScriptContext |
|---|
getAttributesScope, getBindings, getScopes, removeAttribute, setBindings, setReader |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface php.java.script.IPhpScriptContext |
|---|
getContinuation, setContinuation, setWriter |
| Methods inherited from interface php.java.bridge.Invocable |
|---|
call |
| Methods inherited from interface php.java.bridge.http.IContext |
|---|
getAttributesScope, removeAttribute |
| Constructor Detail |
|---|
public PhpSimpleHttpScriptContext()
| Method Detail |
|---|
public void initialize(javax.servlet.Servlet servlet,
javax.servlet.ServletContext ctx,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
servlet - The servletctx - The ServletContextreq - The HttpServletRequestres - The HttpServletResponse
public java.lang.Object getAttribute(java.lang.String key,
int scope)
getAttribute in interface ScriptContextgetAttribute in interface IContextgetAttribute in class SimpleScriptContextkey - the name of the attributescope - the level of scope
public java.lang.Object getAttribute(java.lang.String name)
throws java.lang.IllegalArgumentException
getAttribute in interface ScriptContextgetAttribute in interface IContextgetAttribute in class SimpleScriptContextname - the name of the attribute
java.lang.IllegalArgumentException - if the name is null
public void setAttribute(java.lang.String key,
java.lang.Object value,
int scope)
throws java.lang.IllegalArgumentException
setAttribute in interface ScriptContextsetAttribute in interface IContextsetAttribute in class SimpleScriptContextkey - the name of the attributevalue - the value of the attributescope - the level of the scope
java.lang.IllegalArgumentException - if the name is null scope is
invalidpublic javax.servlet.http.HttpServletResponse getResponse()
public javax.servlet.http.HttpServletRequest getRequest()
public javax.servlet.ServletContext getContext()
public java.io.Writer getWriter()
Writer for scripts to use when displaying output.
getWriter in interface ScriptContextgetWriter in interface IContextgetWriter in interface IPhpScriptContextgetWriter in class AbstractPhpScriptContextWriter.public java.io.Writer getErrorWriter()
Writer used to display error output.
getErrorWriter in interface ScriptContextgetErrorWriter in class AbstractPhpScriptContextWriterpublic java.io.Reader getReader()
Reader to be used by the script to read
input.
getReader in interface ScriptContextgetReader in class SimpleScriptContextReader.
public java.lang.Object init(java.lang.Object callable)
throws java.lang.Exception
init in interface IManagedcallable - Its call() method will be called synchronized.
java.lang.Exception - The result of the call() invocation.public void onShutdown(java.lang.Object closeable)
onShutdown in interface IManagedcloseable - Its close() method will be called before the context or the VM terminates.public java.lang.Object getHttpServletResponse()
getHttpServletResponse in interface IContextpublic java.lang.Object getHttpServletRequest()
getHttpServletRequest in interface IContextpublic java.lang.Object getServlet()
getServlet in interface IContextpublic java.lang.Object getServletConfig()
getServletConfig in interface IContextpublic java.lang.Object getServletContext()
getServletContext in interface IContextpublic java.lang.String getRealPath(java.lang.String path)
getRealPath in interface IContextpath - the relative path to an existing resource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||