net.spy.jwebkit.struts
Class ScriptAction

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by net.spy.jwebkit.struts.JWebAction
          extended by net.spy.jwebkit.struts.ScriptAction
Direct Known Subclasses:
BSHAction, PyScriptAction

public abstract class ScriptAction
extends JWebAction

Abstract superclass for all struts actions that will execute server-side scripts.

The basic way that script actions work is to create an instance of a scripting engine, set the basic struts action parameters (mapping, form, request, response) and get the name of the forward in the rv variable from the interpreter. The default value of rv is next. If this is acceptable, it need not be provided by the script.


Field Summary
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
ScriptAction()
           
 
Method Summary
protected abstract  java.lang.String getExtension()
          Get the extension the script files for this script engine will use.
protected  java.lang.String getPathToScript(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Get the path to the script this action should execute.
 
Methods inherited from class net.spy.jwebkit.struts.JWebAction
execute, getLogger, spyCancel, spyExecute
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptAction

public ScriptAction()
Method Detail

getExtension

protected abstract java.lang.String getExtension()
Get the extension the script files for this script engine will use.

Returns:
the extension (i.e. .jy)

getPathToScript

protected java.lang.String getPathToScript(org.apache.struts.action.ActionMapping mapping,
                                           org.apache.struts.action.ActionForm form,
                                           javax.servlet.http.HttpServletRequest request,
                                           javax.servlet.http.HttpServletResponse response)
                                    throws java.lang.Exception
Get the path to the script this action should execute.

Throws:
java.lang.Exception


Copyright © 1995-2007 SPY Internetworking. All Rights Reserved.