|
||||||||||
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.lang.String |
getContextString()
Return the context string, for example http://localhost:8080/JavaBridge |
java.io.Writer |
getErrorWriter()
Returns the Writer used to display error output. |
java.io.Reader |
getReader()
Returns a Reader to be used by the script to read
input. |
javax.servlet.http.HttpServletRequest |
getRequest()
Get the HttpServletRequest |
javax.servlet.http.HttpServletResponse |
getResponse()
Get the servlet response |
java.lang.String |
getSocketName()
Return the socket name, for example 8080 |
java.io.Writer |
getWriter()
Returns the Writer for scripts to use when displaying output. |
void |
initialize(javax.servlet.Servlet servlet,
javax.servlet.ServletContext ctx,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Initialize the context. |
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 HttpServletResponsepublic java.lang.Object getAttribute(java.lang.String key, int scope)
getAttribute
in interface ScriptContext
getAttribute
in interface IContext
getAttribute
in class SimpleScriptContext
key
- 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 ScriptContext
getAttribute
in interface IContext
getAttribute
in class SimpleScriptContext
name
- the name of the attribute
java.lang.IllegalArgumentException
- if the name is nullpublic void setAttribute(java.lang.String key, java.lang.Object value, int scope) throws java.lang.IllegalArgumentException
setAttribute
in interface ScriptContext
setAttribute
in interface IContext
setAttribute
in class SimpleScriptContext
key
- 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.lang.String getContextString()
getContextString
in interface IPhpScriptContext
getContextString
in class AbstractPhpScriptContext
public java.lang.String getSocketName()
getSocketName
in interface IPhpScriptContext
getSocketName
in class AbstractPhpScriptContext
public java.io.Writer getWriter()
Writer
for scripts to use when displaying output.
getWriter
in interface ScriptContext
getWriter
in interface IContext
getWriter
in interface IPhpScriptContext
getWriter
in class AbstractPhpScriptContext
Writer
.public java.io.Writer getErrorWriter()
Writer
used to display error output.
getErrorWriter
in interface ScriptContext
getErrorWriter
in class AbstractPhpScriptContext
Writer
public java.io.Reader getReader()
Reader
to be used by the script to read
input.
getReader
in interface ScriptContext
getReader
in class SimpleScriptContext
Reader
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |