php.java.script
Class PhpSecureScriptContext

java.lang.Object
  extended by php.java.script.PhpScriptContextDecorator
      extended by php.java.script.PhpSecureScriptContext
All Implemented Interfaces:
ScriptContext, IContext, IManaged, Invocable, IPhpScriptContext

public class PhpSecureScriptContext
extends PhpScriptContextDecorator

A decorator which enables secure (HTTPS) connections. Call engine.setContext(new PhpSecureScriptContext(engine.getContext())) before executing the engine.

Author:
jostb

Field Summary
 
Fields inherited from interface php.java.bridge.http.IContext
ENGINE_SCOPE, GLOBAL_SCOPE, JAVA_BRIDGE, PHP_PROCEDURE, SERVLET, SERVLET_CONFIG, SERVLET_CONTEXT, SERVLET_REQUEST, SERVLET_RESPONSE
 
Fields inherited from interface javax.script.ScriptContext
ENGINE_SCOPE, GLOBAL_SCOPE
 
Constructor Summary
PhpSecureScriptContext(ScriptContext ctx)
          Create a new PhpCompiledScriptContext using an existing PhpScriptContext
 
Method Summary
 java.lang.String getRedirectURL(java.lang.String webPath)
          Return the redirect string, for example http://localhost:8080/webPath Used by the non-compiling script engines to hard-code the back-end URL in the Java.inc
 
Methods inherited from class php.java.script.PhpScriptContextDecorator
call, createContinuation, get, getAll, getAttribute, getAttribute, getAttributesScope, getBindings, getContextServer, getContinuation, getErrorWriter, getHttpServletRequest, getHttpServletResponse, getReader, getRealPath, getRedirectString, getRedirectString, getScopes, getServlet, getServletConfig, getServletContext, getSocketName, getWriter, init, onShutdown, put, putAll, remove, removeAttribute, setAttribute, setBindings, setContinuation, setErrorWriter, setReader, setWriter, startContinuation
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhpSecureScriptContext

public PhpSecureScriptContext(ScriptContext ctx)
Create a new PhpCompiledScriptContext using an existing PhpScriptContext

Parameters:
ctx - the script context to be decorated
Method Detail

getRedirectURL

public java.lang.String getRedirectURL(java.lang.String webPath)
Return the redirect string, for example http://localhost:8080/webPath Used by the non-compiling script engines to hard-code the back-end URL in the Java.inc

Specified by:
getRedirectURL in interface IContext
Overrides:
getRedirectURL in class PhpScriptContextDecorator
Parameters:
webPath - Usually request.getContextPath()+request.getServletPath()
Returns:
the redirect string