Package sk.iway.iwcm.system.stripes
Class ActionContextJavaScriptResolution
java.lang.Object
sk.iway.iwcm.system.stripes.ActionContextJavaScriptResolution
- All Implemented Interfaces:
net.sourceforge.stripes.action.Resolution
public class ActionContextJavaScriptResolution
extends Object
implements net.sourceforge.stripes.action.Resolution
ActionContextJavaScriptResolution.java
Resolution that will convert a Java object web to a web of JavaScript objects and arrays, and
stream the JavaScript back to the client. The output of this resolution can be evaluated in
JavaScript using the eval() function, and will return a reference to the top level JavaScript
object. For more information see JavaScriptBuilder
Resolution builds up result from the object of current ActionBean context returning simple containing involved validation errors if they occur.
source: http://blog.novoj.net/2008/01/25/running-ajax-with-jquery-in-stripes-framework/-
Constructor Summary
ConstructorsConstructorDescriptionActionContextJavaScriptResolution
(net.sourceforge.stripes.action.ActionBean actionBean) Constructs a new JavaScriptResolution that will convert the supplied object to JavaScript. -
Method Summary
Modifier and TypeMethodDescriptioncomposeErrorsHtml
(net.sourceforge.stripes.validation.ValidationErrors errors, javax.servlet.ServletRequest request) Compose HTML snippet with messages based on standard properties enveloping used by Stripes <html:messages/> tag.void
execute
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Converts the object passed in to JavaScript and streams it back to the client.
-
Constructor Details
-
ActionContextJavaScriptResolution
public ActionContextJavaScriptResolution(net.sourceforge.stripes.action.ActionBean actionBean) Constructs a new JavaScriptResolution that will convert the supplied object to JavaScript.- Parameters:
actionBean
-
-
-
Method Details
-
execute
public void execute(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception Converts the object passed in to JavaScript and streams it back to the client.- Specified by:
execute
in interfacenet.sourceforge.stripes.action.Resolution
- Throws:
Exception
-
composeErrorsHtml
public String composeErrorsHtml(net.sourceforge.stripes.validation.ValidationErrors errors, javax.servlet.ServletRequest request) Compose HTML snippet with messages based on standard properties enveloping used by Stripes <html:messages/> tag.- Parameters:
errors
-request
-- Returns:
-