1.struts2快速配置: A.到http://struts.apache.org下载struts2开发包struts-2.3.32-all.zip B.新建web项目并添加struts2依赖的jar文件 C.在web.xml配置struts2核心控制器(核心过滤器) D.在src下新建struts2的配置文件:struts.xml,并引入dtd(struts2-core-2.3.32.jar--àstruts-2.3.dtd) E.编写业务逻辑Action(LoginAction) pack…
Java后台处理框架之struts2学习总结 最近我在网上了解到,在实际的开发项目中struts2的使用率在不断降低,取而代之的是springMVC.可能有很多的朋友看到这里就会说,那还不如不学struts2,直接学习springMVC算了.如果你急于忙着开发项目,这个想法没错.但是,我在这里想说一下的就是,框架其实是对基础代码的封装,对流行功能的优化,为了提高开发效率而存在的.好比武林大会上降龙十八掌,金钟罩,铁布衫,说到底大家还是要靠拳打脚踢的嘛.Struts2,springMVC就是各种招…
Struts2登录 1. 需要注意:Struts2需要运行在JRE1.5及以上版本 2. 在web.xml配置文件中,配置StrutsPrepareAndExecuteFilter或FilterDispatcher <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFi…
1.springmvc01:(基本配置) web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://…
1.基本配置: 步骤一:新建项目并添加spring依赖的jar文件和commons-logging.xx.jar: 步骤二:编写实体类,DAO及其实现类,Service及其实现类; 步骤三:在src下新建配置文件applicationContext.xml,并配置bean节点和property: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springfr…
今天来说说ognl表达式在struts2中的运用. --wh 一.什么是Ognl? 通过百度百科查询到的解释,其中详细的说明了OGNL的作用. 下面我们就对OGNL这5个作用进行讲解 1.存取对象的任意属性,简单说就是对javabean进行操作(重要) 2.调用对象方法. 3.调用类的静态方法 4.索引数组元素 5.操作集合(重 要) 二.OGNL的功能实现 操作之前必须知道如何使用OGNL表达式,并且了解OGNL表达式的取值范围只能在其context和root中,格式为 Ognl.getVal…
1.mybatis01: db.properties: driver=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/test username=root password=root log4j.properties: #Console log4j.appender.Console=org.apache.log4j.ConsoleAppender log4j.appender.Console.layout=org.apache.log4…
在Struts2中,客户端和服务器之间的数据传输全部要用到get.set方法:用set方法 ,可以将表单中的值存入Action类.通过Struts2.0标签,调用get方法将Action类中的结果数据显示在页面上. 当在业务逻辑中需要用到页面传过来的值的时候,只要保证Action中属性的set方法和页面中的name属性值<s:textfield name=""/>相同即可.(去掉set,方法名大写变小写) 当在显示页面中需要用到业务逻辑中的返回值时,只要保证页面标签的val…
1.显示4位验证码 注:大小写字母.数字混合 public static void main(String[] args) { String s="abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";//设定验证码的集合 String s1=""; for(int i=0;i<4;i++){ int n=(int)(Math.random()*1000)%s.length();//取余…
sencha-touch-debug.js      供开发时用sencha-touch.js   供发布时用sencha-touch-all.js All     供不能使用SDK构建应用程序时,将应用程序投入正式运行时用sencha-touch-all-debug.js All     供不能使用SDK构建应用程序时,处于开发阶段时用sencha-touch-all-compat.js All   供升级Sencha Touch 1.0的应用程序时用 我使用sencha-touch-debu…