用MyEclipse 2013 Blue 图解2分钟搞定Struts 1.2.x
myeclipse-blue-2013 myeclipse-pro-2013
这几天非常无聊网上看到新版本,那Struts1.x来先体验以下...
![](https://images.cnblogs.com/cnblogs_com/nlsoft/462757/o_demo_Struts.1.2.x_001.png)
![](https://images.cnblogs.com/cnblogs_com/nlsoft/462757/o_demo_Struts.1.2.x_002.png)
新建WebProject
![](https://images.cnblogs.com/cnblogs_com/nlsoft/462757/o_demo_Struts.1.2.x_003.png)
插入Struts1.x
![](https://images.cnblogs.com/cnblogs_com/nlsoft/462757/o_demo_Struts.1.2.x_004.png)
插入Struts 1.2 From Declaration 填写Use case,Form Properties
![](https://images.cnblogs.com/cnblogs_com/nlsoft/462757/o_demo_Struts.1.2.x_005.png)
选择Create JSP form
![](https://images.cnblogs.com/cnblogs_com/nlsoft/462757/o_demo_Struts.1.2.x_006.png)
修改action="/login"
![](https://images.cnblogs.com/cnblogs_com/nlsoft/462757/o_demo_Struts.1.2.x_007.png)
增加ok.jsp
![](https://images.cnblogs.com/cnblogs_com/nlsoft/462757/o_demo_Struts.1.2.x_008.png)
增加er.jsp
![](https://images.cnblogs.com/cnblogs_com/nlsoft/462757/o_demo_Struts.1.2.x_009.png)
插入Struts Action
![](https://images.cnblogs.com/cnblogs_com/nlsoft/462757/o_demo_Struts.1.2.x_010.png)
填写Use case,Form Name
![](https://images.cnblogs.com/cnblogs_com/nlsoft/462757/o_demo_Struts.1.2.x_011.png)
增加ok Forward
![](https://images.cnblogs.com/cnblogs_com/nlsoft/462757/o_demo_Struts.1.2.x_012.png)
增加er Forward
![](https://images.cnblogs.com/cnblogs_com/nlsoft/462757/o_demo_Struts.1.2.x_013.png)
在execute方法中插入代码,这样代码写完了,效率非常高:)
![](https://images.cnblogs.com/cnblogs_com/nlsoft/462757/o_demo_Struts.1.2.x_014.png)
配置服务器
![](https://images.cnblogs.com/cnblogs_com/nlsoft/462757/o_demo_Struts.1.2.x_015.png)
选择Tomecat 7.x服务器
![](https://images.cnblogs.com/cnblogs_com/nlsoft/462757/o_demo_Struts.1.2.x_016.png)
启动Tomecat 7.x[如果已经启动就要重新启动,不然会找不到action的错误,初学者在这里很迷茫的部分]
![](https://images.cnblogs.com/cnblogs_com/nlsoft/462757/o_demo_Struts.1.2.x_017.png)
Tomecat 7.x启动成功
![](https://images.cnblogs.com/cnblogs_com/nlsoft/462757/o_demo_Struts.1.2.x_018.png)
验证代码 http://localhost:8080/demo_Struts.1.2.x/form/login.jsp
![](https://images.cnblogs.com/cnblogs_com/nlsoft/462757/o_demo_Struts.1.2.x_019.png)
id中输入nlsoft
![](https://images.cnblogs.com/cnblogs_com/nlsoft/462757/o_demo_Struts.1.2.x_020.png)
显示ok.jsp
![](https://images.cnblogs.com/cnblogs_com/nlsoft/462757/o_demo_Struts.1.2.x_021.png)
id中输入hello
![](https://images.cnblogs.com/cnblogs_com/nlsoft/462757/o_demo_Struts.1.2.x_022.png)
显示er.jsp
![](https://images.cnblogs.com/cnblogs_com/nlsoft/462757/o_demo_Struts.1.2.x_023.png)
struts 1.x 版本修改struts-config.xml配置之后需要重新启动 Tomcat 服务器
![](https://images.cnblogs.com/cnblogs_com/nlsoft/462757/o_demo_Struts.1.2.x_024.png)
download demo_Struts.1.2.x.src