随笔分类 -  Web框架

js动态表格
摘要:Html代码:<html><title>动态表格</title><head></head><body><form method="post" name="subType" action="flowtype_sub_insert.jsp"> <input type="hidden" name="mainTypeID" value=""/> <p> 动态表格:<inp 阅读全文

posted @ 2011-08-22 18:46 archie2010 阅读(1139) 评论(0) 推荐(0) 编辑

Spring AOP解决系统日志备忘
摘要:配置文件: <!-- 操作日志切面声明 --> <bean id="logAspect" class="com.tq365.service.sys.log.SystemLogAspect"/> <aop:config> <aop:aspect ref="logAspect"> </aop:aspect> </aop:config> Java代码:/** * 系统操作日志切面 * * @author archie2010 * since 2011-3-17 下午02 阅读全文

posted @ 2011-06-19 17:59 archie2010 阅读(1889) 评论(0) 推荐(0) 编辑

SpringMVC与Hibernate配置备忘
摘要:SpringMVC与Hibernate整合配置Spring3.0Hibernate3.0web.xml<?xml version="1.0" encoding="UTF-8"?><web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://j 阅读全文

posted @ 2011-05-07 11:35 archie2010 阅读(2082) 评论(0) 推荐(0) 编辑

SpringMVC与Ibatis整合开发配置备忘
摘要:SpringMVC与Ibatis框架整合所使用版本Ibatis 2.3.4Spring 3.0web.xml<?xml version="1.0" encoding="UTF-8"?><web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http: 阅读全文

posted @ 2011-05-06 13:24 archie2010 阅读(10986) 评论(29) 推荐(2) 编辑

SpringMVC SimpleFormController学习备忘
摘要:代码样例参考了Spring包中docs下 MVC-step-by-step教程配置web.xml<?xml version="1.0" encoding="UTF-8"?><web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java 阅读全文

posted @ 2011-05-05 11:47 archie2010 阅读(1457) 评论(0) 推荐(1) 编辑

JPA查询语言JPQL
摘要:JPQL是一种与数据库无关的,基于实体(entity-based)的查询语言使用SQL,你可以直接查询数据库中表的字段;使用JPQL,你可以查找实体的属性。 一个JPQL语句的各个组成部分都是针对实体或者实体的属性进行的操作根本不会用到一个实体所映射的数据库表和字段。下面是你可以创建紧最基本的JPQL语句:SELECT u FROM User 即为 查询从数据库返回所有的User实例使用JPQL语言的CRUD操作/** * JPQL测试查询语句测试 * @author archie2010 * * since 下午10:21:37 */public class JQLTest { /** . 阅读全文

posted @ 2011-04-28 21:27 archie2010 阅读(1931) 评论(0) 推荐(0) 编辑

JPA+Hibernate3 CRUD(增删改查操作)
摘要:JPA与Hibernate3结合的CRUD(增删改查操作)package com.archie.test;import javax.persistence.EntityManager;import javax.persistence.EntityManagerFactory;import javax.persistence.Persistence;import com.archie.model.User;/** * CRUD操作测试 * @author archie2010 * since 2011-4-19下午22:13:26 */public class CrudTest { public 阅读全文

posted @ 2011-04-19 23:01 archie2010 阅读(1395) 评论(0) 推荐(2) 编辑

JPA+Hibernate3入门
摘要:JPA(Java Persistence API.)用于整合现有的ORM技术,可以简化现有Java EE和Java SE应用的对象持久化的开发工作,实现ORM的统一。JPA作为一项对象持久化的标准,不但可以获得Java EE应用服务器的支持,还可以直接在Java SE中使用。JPA必将成为Java持久化解决方案的主流User.javapackage com.archie.model;import javax.persistence.Entity;import javax.persistence.GeneratedValue;import javax.persistence.Id;import 阅读全文

posted @ 2011-04-18 22:14 archie2010 阅读(1005) 评论(0) 推荐(1) 编辑

Ibatis的批量处理-iterateiterate标签
摘要:iterate标签prepend-可被覆盖的SQL语句组成部分,添加在语句的前面(可选)property-类型为java.util.List的用于遍历的元素(必选)open-整个遍历内容体开始的字符串,用于定义括号(可选)close-整个遍历内容体结束的字符串,用于定义括号(可选)conjunction-每次遍历内容之间的字符串,用于定义AND或OR(可选)iterate-遍历类型为java.util.List(或数组)的元素。Java代码 /** * 批量更新测试方法 * @param map */ public void updateListTest(){ Map<String, 阅读全文

posted @ 2011-04-15 16:04 archie2010 阅读(1114) 评论(0) 推荐(0) 编辑

Struts2拦截器defaultStack与paramsPrepareParamsStack
摘要:struts-default.xml中定义了一系列的拦截器和拦截器链同时也定义了一个默认的拦截器defaultStack,一旦定义了默认的拦截器,该拦截器就会对包中的所有的Action起作用,当然如果你的Action中显式地定义了拦截器,默认拦截器就会失去作用,如果想不让他失去作用,也必须显式地定义系统默认的拦截器。 </interceptors> <default-interceptor-ref name="defaultStack"/> <default-class-ref class="com.opensymphony.xwor 阅读全文

posted @ 2011-04-06 12:35 archie2010 阅读(4173) 评论(0) 推荐(0) 编辑

Ibatis打印sql语句--log4j
摘要:所需jar包log4j-1.2.11.jarlog4j配置文件log4j.properties# For JBoss: Avoid to setup Log4J outside $JBOSS_HOME/server/default/deploy/log4j.xml!# For all other servers: Comment out the Log4J listener in web.xml to activate Log4J.log4j.rootLogger=INFO, stdout, logfilelog4j.appender.stdout=org.apache.log4j.Conso 阅读全文

posted @ 2011-03-30 17:01 archie2010 阅读(4393) 评论(0) 推荐(0) 编辑

Ibatis,Spring整合(注解方式注入)
摘要:applicationContext.xml<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context=&quo 阅读全文

posted @ 2011-03-03 14:56 archie2010 阅读(16950) 评论(2) 推荐(1) 编辑

MyBatis3入门样例
摘要:User.javapackage com.archie.domain;import java.io.Serializable;@SuppressWarnings("serial")public class User implements Serializable{ private int uid; private String uname; private String upwd; public int getUid() { return uid; } public void setUid(int uid) { this.uid = uid; } public String 阅读全文

posted @ 2011-03-02 18:27 archie2010 阅读(1365) 评论(0) 推荐(0) 编辑

MyBatis3 SqlSessionFactory
摘要:SqlSessionFactoryBuilder:用于建立SqlSessionFactory的工具类,在创建 SqlSessionFactory以后无需再让它存在于应用程序中,文档上说它的生命周期最好在局部方法内,所以在代码中看到//根据资源文件内容建立session工厂SqlSessionFactory sqlMapper = new SqlSessionFactoryBuilder().build(reader);没用引用指向 SqlSessionFactoryBuilder,会被gc回收。SqlSessionFactory:一旦建立,SqlSessionFactory就应该存在于整个应用 阅读全文

posted @ 2011-03-02 14:33 archie2010 阅读(1586) 评论(0) 推荐(0) 编辑

net.sf.json.JSONException: There is a cycle in the hierarchy!
摘要:项目中使用了AJAX技术,JAR包为:json-lib.jar, 在开发过程中遇到了一个JSON-LIB和Hibernate有关的问题:net.sf.json.JSONException: There is a cycle in the hierarchy! at net.sf.json.util.CycleDetectionStrategy$StrictCycleDetectionStrategy.handleRepeatedReferenceAsObject(CycleDetectionStrategy. 主外键关联,产生循环错误需设置过滤,去掉关联Java public Model... 阅读全文

posted @ 2010-09-20 16:30 archie2010 阅读(2634) 评论(0) 推荐(0) 编辑

struts2 action中使用AJAX
摘要:mce:script type="text/javascript" src="scripts/jquery.js" mce_src="scripts/jquery.js"/mce:scriptmce:script type="text/javascript" src="scripts/json.js" mce_src="scripts/json.js"/mce:scriptscript type="text/javascript" $(document).ready(function(){ $("#father").change(function(){ var id=$(t 阅读全文

posted @ 2010-09-05 21:05 archie2010 阅读(777) 评论(0) 推荐(0) 编辑

hibernate多表查询
摘要:映射文件:ShoeModel.hbm.xml?xml version="1.0" encoding="UTF-8"?!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" hibernate-mapping package="com.kaisheng.pojo" class name="ShoeModel" table="t_shoemodel" id n 阅读全文

posted @ 2010-09-02 23:00 archie2010 阅读(2135) 评论(0) 推荐(0) 编辑

hibernate经典配置与测试
摘要:hibernate.cfg.xml<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> & 阅读全文

posted @ 2010-08-17 21:59 archie2010 阅读(663) 评论(0) 推荐(0) 编辑

Struts2之Ognl用法
摘要:OgnlAction.javapackage com.kaishengit.web;import java.util.HashMap;import java.util.List;import java.util.Map;import com.kaishengit.dao.UserDao;import com.kaishengit.vo.User;import com.opensymphony.xwork2.ActionContext;import com.opensymphony.xwork2.ActionSupport;public class OgnlAction extends Acti 阅读全文

posted @ 2010-08-12 22:42 archie2010 阅读(623) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示