|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.script.SimpleScriptContext
php.java.script.PhpSimpleHttpScriptContext
public class PhpSimpleHttpScriptContext
A simple ScriptContext which can be used in servlet environments.
Field Summary | |
---|---|
static int |
APPLICATION_SCOPE
Integer value for the level of APPLICATION_SCOPE |
static int |
REQUEST_SCOPE
Integer value for the level of SCRIPT_SCOPE |
static int |
SESSION_SCOPE
Integer value for the level of SESSION_SCOPE |
Fields inherited from interface javax.script.ScriptContext |
---|
ENGINE_SCOPE, GLOBAL_SCOPE |
Constructor Summary | |
---|---|
PhpSimpleHttpScriptContext()
|
Method Summary | |
---|---|
boolean |
call(PhpProcedureProxy kont)
Call the java continuation with the current continuation kont as its argument. |
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 |
HttpProxy |
getContinuation()
Get the php continuation |
javax.servlet.http.HttpServletRequest |
getRequest()
Get the HttpServletRequest |
javax.servlet.http.HttpServletResponse |
getResponse()
Get the servlet response |
java.io.Writer |
getWriter()
Retrieves an instance of java.io.Writer which can be used by scripts to display their output. |
void |
initialize(javax.servlet.ServletContext ctx,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
PhpScriptWriter writer)
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. |
void |
setContinuation(HttpProxy kont)
Set the php continuation |
void |
setWriter(java.io.Writer writer)
Set the Writer |
Methods inherited from class javax.script.SimpleScriptContext |
---|
getAttributesScope, getBindings, removeAttribute, setBindings |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int REQUEST_SCOPE
public static final int SESSION_SCOPE
public static final int APPLICATION_SCOPE
Constructor Detail |
---|
public PhpSimpleHttpScriptContext()
Method Detail |
---|
public void initialize(javax.servlet.ServletContext ctx, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, PhpScriptWriter writer) throws javax.servlet.ServletException
ctx
- The ServletContextreq
- The HttpServletRequestres
- The HttpServletResponsewriter
- The PhpScriptWriter
javax.servlet.ServletException
public java.lang.Object getAttribute(java.lang.String key, int scope)
SimpleScriptContext
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
SimpleScriptContext
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
SimpleScriptContext
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 or the
scope is invalidpublic java.io.Writer getWriter()
SimpleScriptContext
getWriter
in interface ScriptContext
getWriter
in interface IContext
getWriter
in interface IPhpScriptContext
getWriter
in class SimpleScriptContext
public javax.servlet.http.HttpServletResponse getResponse()
public javax.servlet.http.HttpServletRequest getRequest()
public javax.servlet.ServletContext getContext()
public void setContinuation(HttpProxy kont)
IPhpScriptContext
setContinuation
in interface IPhpScriptContext
kont
- The continuation.public boolean call(PhpProcedureProxy kont) throws java.lang.Exception
Invocable
kont
as its argument.
call
in interface Invocable
kont
- The continuation.
java.lang.Exception
public void setWriter(java.io.Writer writer)
IPhpScriptContext
setWriter
in interface IPhpScriptContext
writer
- The writerpublic HttpProxy getContinuation()
IPhpScriptContext
getContinuation
in interface IPhpScriptContext
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |