在myeclipse中实现struts2的登录例子

2009-04-29 408 0

  在myeclipse中实现struts2的登录例子

  环境:myeclipse 6.0.1 GA

  jdk:myeclipse自带

  tomcat:6.0

  struts2:2.1.6

  过程:

  1、使用myeclipse建立web工程

  2、由于在struts2中使用过滤器调用action的机制,所以需要在web.xml中添加过滤器代码

  

  struts2

  

  org.apache.struts2.dispatcher.FilterDispatcher

  

  

  

  struts2

  /*

  

  3、将struts2的所需的jar拷到lib目录下

  commons-logging-1.1.jar

  freemarker-2.3.13.jar

  ognl-2.6.11.jar

  struts2-core-2.1.6.jar

  xwork-2.1.2.jar

  在许多教程中都写着,只要有以上5个jar包就可以了,但是我在使用中却不行,添加了commons-fileupload-1.2.1.jar这个jar包以后,才可以正确执行。

  4、在src建立struts.xml文件,

  

  http://struts.apache.org/dtds/struts-2.0.dtd

  

  

  

  /result.jsp

  

  

  

  5、建立LoginAction文件

  6、建立login.jsp和result.jsp文件

  7、发布





相关文章

15年来的手艺之路:手艺人赵鹏的自述
纪念 Google 25 周年:从搜索引擎到科技巨头的演变之路
1小时编写一个支持七牛上传的 markdown 客户端3(打包发布篇)
1小时编写一个支持七牛上传的 markdown 客户端2(代码优化篇)
1小时编写一个支持七牛上传的 markdown 客户端1(技术实现篇)
从 wordpress 转移到 hexo

Leave a Reply