📄 helloworldaction.java
字号:
package cn.webwheel.tutorials.helloworld;
import cn.webwheel.Action;
import cn.webwheel.Result;
// 一个Action类,实现Action接口,并且可通过实现cn.webwheel.WebContextAware接口
// 来获得cn.webwheel.WebContext对象,此对象可获得当前的环境信息,request、response对象等
public class HelloWorldAction implements Action {
// Action的唯一接口方法,此方法在servlet容器接收到"/HelloWorld"地址请求的时候被调用
// 这个映射已在WebMain类中设置
// 此方法返回一个cn.webwheel.Result接口,此接口在逻辑上负责对结果返回的渲染工作
public Result execute() throws Exception {
// 在服务器控制台输出信息
System.out.println("WebWheel at server");
// 返回一个结果
return new HelloWorldResult();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -