|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.stripes.examples.ajax.CalculatorActionBean
public class CalculatorActionBean
A very simple calculator action that is designed to work with an ajax front end. Handles 'add' and 'divide' events just like the non-ajax calculator. Each event calculates the result, and then "streams" it back to the browser. Implements the ValidationErrorHandler interface to intercept any validation errors, convert them to an HTML message and stream the back to the browser for display.
Constructor Summary | |
---|---|
CalculatorActionBean()
|
Method Summary | |
---|---|
net.sourceforge.stripes.action.Resolution |
add()
Handles the 'add' event, adds the two numbers and returns the result. |
net.sourceforge.stripes.action.Resolution |
divide()
Handles the 'divide' event, divides number two by oneand returns the result. |
net.sourceforge.stripes.action.ActionBeanContext |
getContext()
|
double |
getNumberOne()
|
double |
getNumberTwo()
|
net.sourceforge.stripes.action.Resolution |
handleValidationErrors(net.sourceforge.stripes.validation.ValidationErrors errors)
Converts errors to HTML and streams them back to the browser. |
void |
setContext(net.sourceforge.stripes.action.ActionBeanContext context)
|
void |
setNumberOne(double numberOne)
|
void |
setNumberTwo(double numberTwo)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CalculatorActionBean()
Method Detail |
---|
public net.sourceforge.stripes.action.ActionBeanContext getContext()
getContext
in interface net.sourceforge.stripes.action.ActionBean
public void setContext(net.sourceforge.stripes.action.ActionBeanContext context)
setContext
in interface net.sourceforge.stripes.action.ActionBean
public net.sourceforge.stripes.action.Resolution handleValidationErrors(net.sourceforge.stripes.validation.ValidationErrors errors) throws Exception
handleValidationErrors
in interface net.sourceforge.stripes.validation.ValidationErrorHandler
Exception
@DefaultHandler public net.sourceforge.stripes.action.Resolution add()
public net.sourceforge.stripes.action.Resolution divide()
public double getNumberOne()
public void setNumberOne(double numberOne)
public double getNumberTwo()
public void setNumberTwo(double numberTwo)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |