1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE webflow PUBLIC "-//SPRING//DTD WEBFLOW//EN" "http://www.springframework.org/dtd/spring-webflow.dtd"> <webflow id="myFlow" start-state="displayForm"> <view-state id="displayForm" view="form"> <entry> <action bean="myFlowAction" method="setupForm"/> </entry> <transition on="submit" to="processSubmit"> <action bean="myFlowAction" method="bindAndValidate"/> </transition> </view-state> <action-state id="processSubmit"> <action bean="myFlowAction"/> <transition on="success" to="finish"/> </action-state> <end-state id="finish" view="success"/> </webflow> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | try { if (operator == "plus") cocoon.sendPage("result.html", {result: a + b}); else if (operator == "minus") cocoon.sendPage("result.html", {result: a - b}); else if (operator == "multiply") cocoon.sendPage("result.html", {result: a * b}); else if (operator == "divide") cocoon.sendPage("result.html", {result: a / b}); else cocoon.sendPage("invalidOperator.html", {operator: operator}); } catch (e) { cocoon.sendPage("error.html", {message: "Operation failed: " + e.toString()}); } |
1 2 3 4 5 6 7 8 9 10 | while (mGuess != answer) { print(template); pause(); guesses++; if (answer < mGuess) { template.setBlock("indication", "lower"); } else if (answer > mGuess).{ template.setBlock("indication", "higher"); } } |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |