Struts2.之HelloWorld简单演示
来源:互联网 发布:用友网络 编辑:程序博客网 时间:2024/05/20 20:44
新建一个web project:hello-struts
1.拷贝struts的jar包到项目中(apps中的blank项目中可以找到这些jar包)
2.讲struts2的过滤器拷贝到web.xml中
3.配置struts2的配置文件(在src目录中创建struts.xml文件)
4.创建action(action就是一个POJO类)
- 4.1 为action编写execute方法
public String execute(){ System.out.println("Hello struts."); return "success"; }
- 4.2 在struts.xml文件中配置action和返回结果集
<action name="hello" class="net.qbzhong.action.HelloAction" method="execute"> <result name="success">/hello.jsp</result> </action>
直接运行,进入index.jsp页面
在地址栏后面加上hello,进入hello.jsp
0 0
- Struts2.之HelloWorld简单演示
- Struts2之HelloWorld程序
- Struts2之HelloWorld
- HelloWorld之Struts2
- struts2之HelloWorld
- struts2学习之HelloWorld
- struts2之helloworld
- Struts2之HelloWorld
- Struts2学习之helloworld
- Struts2入门之HelloWorld
- Struts2(一)-Struts2之HelloWorld
- maven+struts2项目简单演示
- 2、Struts2之HelloWorld程序
- (二)struts2.0之helloworld
- Struts2之HelloWorld环境搭建
- Struts2之2.5.10.1HelloWorld
- 简单的helloworld 之行
- struts2 一个简单的 struts2程序(HelloWorld)
- xcode debug 2
- AC自动机
- Shell脚本编程入门(一)
- STL算法设计理念 - 预定义函数对象
- emgu在VS2010下可能出现的几种常见问题解决方案
- Struts2.之HelloWorld简单演示
- 使用 TFDConnection 的 pooled 连接池
- span中内容随着数字长度的增加而增大
- 寻找所有的素数的python实现
- 编程10大算法概念汇总
- Eclipse 设置调优使用
- MySQLdb安装|Centos 7 下关联 python 和 MariaDB or MySQL
- 算法竞赛入门经典例题-优先队列(阿格斯)
- LightOJ 1036