如果您无法下载资料,请参考说明:
1、部分资料下载需要金币,请确保您的账户上有足够的金币
2、已购买过的文档,再次下载不重复扣费
3、资料包下载后请先用软件解压,在使用对应软件打开
Struts2入门必练小项目:增删改及登录功能实现。Eclipse+struts2+oracle+jdbcWeb开发技术框架入门小项目,一般都是从增删改功能实现开始入手,就像学编程语言几乎从“HelloWorld”一样的经典,本人初入web领域,也是要实现该功能,通过几天的实践,得到一个比较完善的文档,现在整合一下分享给和我一样的carragebird!环境搭建导入必要的包,我所建工程引入如下包:Classes12.jarcommons-fileupload-1.2.2.jarcommons-io-2.0.1.jarcommons-lang-2.5.jarfreemarker-2.3.16.jarjavassist-3.11.0.GA.jarognl-3.0.1.jarojdbc14.jarstruts-core-2.2.3.jarxwork-core-2.2.3.jar引入的包具体的版本同struts的版本有关系,我的是sturts2.2.6.配置web.xml我的web.xml内容如下:<?xmlversion="1.0"encoding="UTF-8"?><web-appxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns="http://java.sun.com/xml/ns/javaee"xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"xsi:schemaLocation="http://java.sun.com/xml/ns/javaeehttp://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"id="WebApp_ID"version="2.5"><display-name>webDemo</display-name>//我的工程名为webDemo<filter>//struts2新增核心内容,拦截器<filter-name>struts2</filter-name><filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class><!--init-param><param-name>config</param-name><param-value>struts-default.xml,struts-plugin.xml</param-value></init-param--></filter><filter-mapping><filter-name>struts2</filter-name><url-pattern>/*</url-pattern></filter-mapping><welcome-file-list>//默认显示页面<welcome-file>index.html</welcome-file><welcome-file>index.htm</welcome-file><welcome-file>index.jsp</welcome-file><welcome-file>default.html</welcome-file><welcome-file>default.htm</welcome-file><welcome-file>default.jsp</welcome-file></welcome-file-list></web-app>如果有不懂的地方,百度搜索一下“web.xml的配置”。配置struts.xml通俗一点来书,本人觉得Struts.xml就像一个导航,也是一个映射关系,页面的跳转,及动作的发生,都是struts.xml配置文件的作用,弄懂了struts.xml,基本上struts的原理你就弄清楚了,所以本人重点讲解一下自己所遇到的问题。(该文档是最终文档,请对照自己的来理解。)<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEstrutsPUBLIC"-//ApacheSoftwareFoundation//DTDStrutsConfiguration2.0//EN""http://struts.apache.org/dtds/struts-2.0.dtd"><struts><includefile="struts-default.xml"></include><packagename="login"extends=