📄 helloworld.java
字号:
/* * WebWork, Web Application Framework * * Distributable under Apache license. * See terms of license at opensource.org */package webwork.examples.helloworld;import webwork.action.ActionSupport;import webwork.action.CommandDriven;/** * Hello World action. Generate greeting phrase. * * @author Rickard 謆erg (rickard@middleware-company.com) * @version $Revision: 1.5 $ */public class HelloWorld extends ActionSupport implements CommandDriven{ // Attributes ---------------------------------------------------- String phrase = ""; String name = ""; String greeting; // Public -------------------------------------------------------- public void setName(String name) { this.name = name; } public String getName() { return name; } public void setPhrase(String phrase) { this.phrase = phrase; } public String getPhrase() { return phrase; } public String getGreeting() { return greeting; } // Action implementation ---------------------------------------- protected void doValidation() { if (phrase.equals("")) addError("phrase", "Missing greeting"); if (name.equals("")) addError("name", "Missing name"); } protected String doExecute() { // Compute greeting greeting = phrase+" "+name; // Show result return SUCCESS; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -