- 浏览: 1251780 次
- 性别:
- 来自: 杭州
文章分类
- 全部博客 (399)
- 心情故事 (12)
- java (115)
- linux (55)
- 关系型数据库 (35)
- struts,jsf,spring (11)
- jdbc,hibernate,ibatis (11)
- jsp,jstl,c:tag,标签库 (2)
- ejb,webservice (1)
- tomcat,jboss,jetty,weblogic,websphere (15)
- java网络编程 (6)
- java线程 (0)
- js,jquery,json,xml,dom,html.regex (25)
- 设计模式 (6)
- BUG记录 (2)
- ant (2)
- jsp,servlet (4)
- swing (6)
- lucene+nutch (6)
- log4j (2)
- windows doc (2)
- ruby (1)
- ruby on rails (3)
- 操作系统网络 (18)
- apache 错误 (1)
- tomcat (10)
- jboss (9)
- jetty (9)
- weblogic (9)
- websphere (10)
- apache (2)
- AIX的iostat命令查看系统磁盘的使用情况 (1)
- oracle 统计一个表格有多少列 (1)
- Exception in thread "main" java.security.KeyStoreException: Windows-MY not found (1)
- jsp (1)
- jstl (1)
- c:tag (1)
- 标签库 (1)
- struts (1)
- jsf (1)
- spring (2)
- oracle,sqlplus (2)
- sqlplus (2)
- show errors (1)
- proc (1)
- function (1)
- ORA-06544: PL/SQL: internal error (1)
- arguments: [55916] (1)
- [] (7)
- 终端身份实施文档 (1)
- 重装系统之后飞鸽传书只能看到自己 (1)
- vsftp "上传 553 Could not create file" (1)
- startWebLogic.sh启动失败,提示Error initializing Embedded LDAP Server (1)
- java agent 注册为 windows 服务 (1)
- centos (1)
- svn (1)
- apr (1)
- apr-util (1)
- activemq (2)
- oracle (5)
- mysql (3)
- nosql (3)
- NSIS (1)
- windows wmic (1)
- c 指针 (1)
- c c++ (0)
- jmeter (0)
- 性能测试 (0)
- linux,备份 (2)
- C++ ,Virtual (1)
- windows dos (1)
- android (2)
- 大数据,云计算 (1)
- JVM垃圾收集 (1)
- jdbc (2)
- invoke (1)
- hibernate (1)
- ibatis (1)
- 个人开源项目源码收藏 (1)
- 批处理 (1)
- Mongodb mapreduce (8)
- kettle (1)
- Mongodb capped (1)
- mongodb gridfs (1)
- Mongodb 入门基础知识 (1)
- mongodb (8)
- hadoop2.5.1 (1)
- hadoop (4)
- eclipse (1)
- hdfs fs (1)
- elipse hadoop plugin (1)
- PHP相关知识 (1)
- js (1)
- jquery (1)
- json (1)
- xml (1)
- dom (1)
- html.regex (1)
- 网络知识 (1)
- nginx (1)
- docker (1)
- 测试 (1)
- nodejs (1)
- iptables (1)
- linux gitlab (1)
最新评论
-
July01:
最近了解到一款StratoIO打印控件,功能如下:1、Html ...
web页面调用window.print()函数实现打印的功能 -
hxdtech:
非常感谢!
我在学习ibatis时的培训ppt -
zmwxiaoming:
what 能连数据库不错
SOLR的学习整理 -
springdata_springmvc:
java程序语言学习教程 地址http://www.zuida ...
java获取当前操作系统的信息 -
huanzei:
整理的不错,
oracle lpad函数
最近自己华了几天的时间,搭了一个ssh的架构,现在写出来。
版本:struts2.0,spring2.6,hibernate3.4
数据库:oracle
1web.xml
<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <display-name>rachel</display-name> <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/config/spring/applicationContext-persistence.xml /WEB-INF/config/spring/applicationContext-business.xml </param-value> </context-param> <context-param> <param-name>webAppRootKey</param-name> <param-value>rachel.root</param-value> </context-param> <context-param> <param-name>log4jConfigLocation</param-name> <param-value>/WEB-INF/config/log4j.properties</param-value> </context-param> <listener> <listener-class> org.springframework.web.context.request.RequestContextListener </listener-class> </listener> <listener> <listener-class> org.springframework.web.util.Log4jConfigListener </listener-class> </listener> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <filter> <filter-name>struts2</filter-name> <filter-class> org.apache.struts2.dispatcher.FilterDispatcher </filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <filter> <filter-name>Encoding</filter-name> <filter-class> org.springframework.web.filter.CharacterEncodingFilter </filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> </filter> <filter-mapping> <filter-name>Encoding</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <session-config> <session-timeout>30</session-timeout> </session-config> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app>
2 jdbc.properties
jdbc.jdbcUrl=jdbc:oracle:thin:@172.16.4.37:1521:xe jdbc.user=exchange_user jdbc.password=exchange_user jdbc.driverClass=oracle.jdbc.driver.OracleDriver jdbc.initialPoolSize=5 jdbc.maxPoolSize=5
3 log4j.properties
### direct log messages to stdout ### log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.Target=System.out log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n ### direct messages to file log ### log4j.appender.file=org.apache.log4j.RollingFileAppender log4j.appender.file.File=${capaa2.3.root}/WEB-INF/log/rachel.log log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n ### set log levels - for more verbose logging change 'info' to 'debug' ### log4j.rootLogger=info,stdout
spring配置文件
<?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:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"> <context:annotation-config/> <tx:annotation-driven transaction-manager="transactionManager"/> <context:component-scan base-package="com.mchz.common.business" /> </beans>
<?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:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"> <import resource="applicationContext-propertyConfigurer.xml" /> <!-- c3p0 datasource --> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close" p:driverClass="${jdbc.driverClass}" p:jdbcUrl="${jdbc.jdbcUrl}" p:user="${jdbc.user}" p:password="${jdbc.password}"> <property name="initialPoolSize" value="${jdbc.initialPoolSize}" /> <property name="maxPoolSize" value="${jdbc.maxPoolSize}" /> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop> <prop key="hibernate.show_sql">true</prop> <!-- <prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.SingletonEhCacheProvider</prop> <prop key="hibernate.cache.use_second_level_cache">true</prop> <prop key="hibernate.cache.use_query_cache">true</prop> <prop key="hibernate.cache.use_structured_entries">true</prop> <prop key="hibernate.connection.release_mode">auto</prop> --> </props> </property> <property name="packagesToScan" value="com.mchz.common.domain.persistence" /> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory"></property> </bean> </beans>
<?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:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="ignoreResourceNotFound" value="true"/> <property name="locations"> <list> <value>/WEB-INF/config/jdbc.properties</value> </list> </property> </bean> <!-- bean id="propertyConfigurer" class="org.jasypt.spring.properties.EncryptablePropertyPlaceholderConfigurer"> <constructor-arg ref="configurationEncryptor" /> <property name="locations"> <list> <value>/WEB-INF/config/system.properties</value> <value>/WEB-INF/config/jdbc.properties</value> </list> </property> </bean --> </beans>
struts配置文件
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <include file="struts-default.xml" /> <constant name="struts.enable.DynamicMethodInvocation" value="true" /> <include file="struts-default.xml" /> <package name="default" extends="struts-default"> <interceptors> <interceptor-stack name="s2Stack"> <interceptor-ref name="model-driven" /> <interceptor-ref name="params" /> </interceptor-stack> </interceptors> <action name="user_login" class="com.mchz.common.web.controller.LoginAction"> <result name="input">index.jsp</result> <result name="sucess">sucess.jsp</result> <result name="error">error.jsp</result> <interceptor-ref name="s2Stack" /> </action> <action name="user_reg" class="com.mchz.common.web.controller.LoginAction" method="userReg"> <result name="input">index.jsp</result> <result name="sucess">sucess.jsp</result> <result name="error">error.jsp</result> </action> </package> </struts>
struts.properties
struts.devMode=false struts.xml.reload=true struts.objectFactory = spring struts.objectFactory.spring.autoWire = type
index.jsp
<%@ page language="java" contentType="text/html; charset=GB2312" pageEncoding="UTF-8"%> <%@ taglib prefix="s" uri="/struts-tags"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>这是一个登录页面</title> </head> <body> <table border="1" align="center" > <s:form validate="true" name="form1" method="post" action="user_login.action"> <tr> <td>用户名</td> <td><s:textfield name="user.userName"></s:textfield></td> </tr> <tr> <td>密码</td> <td><s:password name="user.passWord"></s:password></td> </tr> <tr> <td>修改</td> <td><a href="<s:url action="Login_login.reg"><s:param name="##" value="123"></s:param></s:url>"> 超链接</a></td> </tr> <tr> <td colspan="2"><s:submit>提交</s:submit></td> </tr> </s:form> <hr></hr> </table> </body> </html>
struts的action
import java.util.List; import javax.servlet.http.HttpServletRequest; import org.apache.struts2.interceptor.ServletRequestAware; import org.springframework.beans.factory.annotation.Autowired; import com.mchz.common.dao.Page; import com.mchz.common.business.UserDaoManager; import com.mchz.common.util.CommonInterf; import com.mchz.common.domain.persistence.User; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionSupport; import com.opensymphony.xwork2.ModelDriven; public class LoginAction extends ActionSupport implements ModelDriven<User>, ServletRequestAware, CommonInterf { private static final long serialVersionUID = 1L; User user; @Autowired private UserDaoManager userDaoManager; private HttpServletRequest request; @Override public User getModel() { return user; } @Override public void setServletRequest(HttpServletRequest request) { this.request = request; } @SuppressWarnings("unchecked") @Override public String execute() throws Exception { System.out.println("这里执行的是方法一"); List userList = this.userDaoManager.checkLogin(user.getUserName(), user .getPassWord()); if (userList != null) { if (userList.size() == 1) { ActionContext.getContext().getSession().put("userObject", userList); return SUCESS; } else { return ERRORS; } } return ERRORS; }
public String userReg() throws Exception { System.out.println(user.getUserName()); this.userDaoManager.save(user); return SUCESS; } public User getUser() { return user; } public void setUser(User user) { this.user = user; } @Override public void validate() { if (user.getUserName() == null || user.getUserName().trim().equals("")) { this.addFieldError("username", "用户名必须输入"); } if (user.getPassWord() == null || user.getPassWord().trim().equals("")) { this.addFieldError("password", "密码必须输入"); } }
import java.util.List; import com.mchz.common.dao.Page; import com.mchz.common.domain.persistence.User; public interface UserDaoManager { public List checkLogin(String username, String password); public void save(User user); public void deleteById(Integer id); public void update(User user); public Page queryByPage(Page page); }
import java.util.Iterator; import java.util.List; import org.hibernate.Query; import org.hibernate.Session; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.mchz.common.business.UserDaoManager; import com.mchz.common.dao.BaseDaoManager; import com.mchz.common.dao.Page; import com.mchz.common.domain.persistence.User; @Service @Transactional public class UserDaoManagerImpl extends BaseDaoManager implements UserDaoManager { @SuppressWarnings("unchecked") @Override public List checkLogin(String username, String password) { List list = getHibernateTemplate().find( "from User where username=? and password=?", new Object[] { username, password });// 这里只是测试代码,会有sql注入问题 return list; } @Override public void deleteById(Integer id) { } @Override public void save(User user) { this.getHibernateTemplate().save(user);// 数据库的默认的时间没有被加上 } @Override public void update(User user) { }
public Page queryByPage(Page page) { page.setTotalCount(getTotalCount(page)); Session session = this.getSession(); Query qlist = session.createQuery("from User"); qlist.setFirstResult(page.getStartNumber()); qlist.setMaxResults(page.getEndNumber()); List list = qlist.list(); page.setItems(list); for (int i = 0; i < list.size(); i++) { User user = (User) list.get(0); System.out.println(user.getUserName()); } return page; } public Integer getTotalCount(Page page) { Session session = this.getSession(); Query q = session.createQuery("select count(*) from User"); Integer totalCount = ((Number) (q.uniqueResult())).intValue(); return totalCount; }
Page.java
package com.mchz.common.dao; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Map; public class Page { public static final int DEFAULT_PAGE_SIZE = 10;// 默认每页大小 private Collection<Object> items = new ArrayList<Object>(); private int currentPage = 1; private int totalCount; // 总记录数 private String orderField; // 排序字段 private boolean ascend; // 是否升序 private Map<Object, Object> searchParameters = new HashMap<Object, Object>(); private int pageSize = DEFAULT_PAGE_SIZE; // 每页大小 private boolean paged = true; private int totalPage; public void setTotalPage(int totalPage) { this.totalPage = totalPage; } public Collection<Object> getItems() { return items; } public void setItems(Collection<Object> items) { this.items = items; } public int getCurrentPage() { return currentPage; } public void setCurrentPage(int currentPage) { this.currentPage = currentPage; } // 设置当前页 public void setCurrentPage(String currentPage) { int tempCurrentPage; if (currentPage == null || "".equals(currentPage) || currentPage.equals("1")) { tempCurrentPage = 1; this.setCurrentPage(tempCurrentPage); } else { try { this.setCurrentPage(Integer.parseInt(currentPage)); } catch (NumberFormatException e) { e.printStackTrace(); } } } public int getTotalCount() { return totalCount; } public void setTotalCount(int count) { this.totalCount = count; } public String getOrderField() { return orderField; } public void setOrderField(String orderField) { this.orderField = orderField; } public boolean isAscend() { return ascend; } public void setAscend(boolean ascend) { this.ascend = ascend; } public Map<Object, Object> getSearchParameters() { return searchParameters; } public void setSearchParameters(Map<Object, Object> searchParameters) { this.searchParameters = searchParameters; } public int getPageSize() { return pageSize; } public void setPageSize(int pageSize) { this.pageSize = pageSize; } /*---------- 计算开始和结束位置---------------------------------*/ public int getStartNumber() { return (this.currentPage - 1) * pageSize + 1; } public int getEndNumber() { if (this.currentPage * pageSize > this.totalCount) { return getStartNumber() + this.totalCount % pageSize - 1; } else { return getStartNumber() + pageSize - 1; } } /*--------------/trustuser/precreate.do------------------------------*/ public int getTotalPage() { int totalPage = (totalCount / pageSize); if (totalCount % pageSize != 0) { totalPage++; } return totalPage; } /** --------------计算总页数------------------- */ public int getPreviewPage() { if (this.currentPage == 1) { return this.currentPage; } else { return currentPage - 1; } } public int getNextPage() { if (this.currentPage == getTotalPage()) { return this.currentPage; } else { return currentPage + 1; } } public void addSearchParameter(Object key, Object value) { if (value instanceof String) { String stringValue = (String) value; value = stringValue.trim(); } this.searchParameters.put(key, value); } public boolean isPaged() { return paged; } public void setPaged(boolean paged) { this.paged = paged; } }
public class BaseDaoManager extends HibernateDaoSupport { @Autowired public void setMySessionFactory(SessionFactory sessionFactory) { setSessionFactory(sessionFactory); } }
@Entity @Table(name = "mc$exchange_user") public class User { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq_usermanager") @SequenceGenerator(name = "seq_usermanager", sequenceName = "seq_usermanager") private Integer id; private String userName; private String passWord; private Integer roleId; private Date regTime; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer getRoleId() { return roleId; } public void setRoleId(Integer roleId) { this.roleId = roleId; } public Date getRegTime() { return regTime; } public void setRegTime(Date regTime) { this.regTime = regTime; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getPassWord() { return passWord; } public void setPassWord(String passWord) { this.passWord = passWord; }
public interface CommonInterf { public static final String ERRORS="error"; public static final String SUCESS="sucess"; public static final String NONE="none"; public String execute()throws Exception; }
发表评论
-
ibatis 对连接池的支持
2009-07-21 15:53 4217ibatis 对连接池的支持有3种,SIMPLE.DB ... -
我在学习ibatis时的培训ppt
2009-04-15 09:40 2771我在学习ibatis时的PPT,现在共享出来给大家,希望对需要 ... -
ibatis的动态sql,call proc等需要注意的地方(经验总结)
2009-04-10 10:06 27651环境:ibatis2.3,spring2.5. ... -
ibatis调用oracle的动态sql,sql大小不能超过32K
2009-04-03 10:22 23561环境:oracle10g,spring2.5,ibatis2 ... -
ibatis调用oracle的函数,存储过程的方法 IN 和OUT /游标(第五章)
2009-04-02 15:48 21451对于全部是in 类 ... -
ibatis的DML的写法(五,六,八章综合)
2009-03-20 14:58 2147<?xml version="1.0&q ... -
ibatis的sqlMap配置文件(包含第三章)
2009-03-20 14:40 2161(1):sqlMapConfig.xml文件是Ibatis ... -
ibatis union oracle(第四章bean)
2009-01-07 10:31 2219ibatis中使用联合查询,com.hzmc. ... -
ibatis的优点和好处(包含一二章节)
2008-12-10 11:15 1967Ibatis的优势。 Ibatis是一个混合性的解决方案,吸 ... -
ibatis jdbcType Boolean oracle(第五章)
2008-12-10 11:11 3796最近在用spring+ibatis+oracle开发一个安全产 ...
相关推荐
3.4 实现spring、struts2.x和hibernate框架集成 3.5 小结 第2篇 典型模块开发 第4章 在线文本编辑器(fckeditor) 4.1 分析fckeditor在线文本编辑器 4.2 fckeditor在线文本编辑器初级应用 4.3 ...
16.2 协同使用Spring和WebWork 2/Struts 2 16.3 集成Spring和Tapestry 16.3.1 集成Spring和Tapestry 3 16.3.2 集成Spring和Tapestry 4 16.4 协同使用Spring和JSF 16.4.1 解析JSF管理的属性 16.4.2 解析Spring...
16.2协同使用spring和webwork2/struts2 16.3集成spring和tapestry 16.3.1集成spring和tapestry3 16.3.2集成spring和tapestry4 16.4协同使用spring和jsf 16.4.1解析jsf管理的属性 16.4.2解析springbean 16.4.3...
16.2 协同使用Spring和WebWork 2/Struts 2 16.3 集成Spring和Tapestry 16.3.1 集成Spring和Tapestry 3 16.3.2 集成Spring和Tapestry 4 16.4 协同使用Spring和JSF 16.4.1 解析JSF管理的属性 16.4.2 解析Spring...
2. Spring 2.0 的新特性 2.1. 简介 2.2. 控制反转(IoC)容器 2.2.1. 更简单的XML配置 2.2.2. 新的bean作用域 2.2.3. 可扩展的XML编写 2.3. 面向切面编程(AOP) 2.3.1. 更加简单的AOP XML配置 2.3.2. 对@AspectJ 切面的...
- **集成支持**:Spring 对主流的应用框架提供了很好的集成支持,比如 Hibernate、JPA、Struts 等,这使得开发基于这些框架的应用变得更加容易。 ##### 1.3 轻量级与重量级概念的划分 - **轻量级**:通常指的是...
6.3 将Spring与Struts 1.x集成 220 6.3.1 问题 220 6.3.2 解决方案 220 6.3.3 工作原理 220 6.4 将Spring与JSF集成 226 6.4.1 问题 226 6.4.2 解决方案 226 6.4.3 工作原理 227 6.5 将Spring与DWR...
2. Spring 2.0 的新特性 2.1. 简介 2.2. 控制反转(IoC)容器 2.2.1. 更简单的XML配置 2.2.2. 新的bean作用域 2.2.3. 可扩展的XML编写 2.3. 面向切面编程(AOP) 2.3.1. 更加简单的AOP XML配置 2.3.2. 对@...
2. Spring 2.0 的新特性 2.1. 简介 2.2. 控制反转(IoC)容器 2.2.1. 更简单的XML配置 2.2.2. 新的bean作用域 2.2.3. 可扩展的XML编写 2.3. 面向切面编程(AOP) 2.3.1. 更加简单的AOP XML配置 2.3.2. 对@...
6.3 将Spring与Struts 1.x集成 220 6.3.1 问题 220 6.3.2 解决方案 220 6.3.3 工作原理 220 6.4 将Spring与JSF集成 226 6.4.1 问题 226 6.4.2 解决方案 226 6.4.3 工作原理 227 6.5 将Spring与DWR...
2.6. 其他 2.6.1. 动态语言支持 2.6.2. 增强的测试支持 2.6.3. JMX 支持 2.6.4. 将Spring 应用程序上下文部署为JCA adapter 2.6.5. 计划任务 2.6.6. 对Java 5 (Tiger) 支持 2.7. 移植到Spring 2.5 2.7.1. ...
2. Spring 2.0和 2.5的新特性 2.1. 简介 2.2. 控制反转(IoC)容器 2.2.1. 新的bean作用域 2.2.2. 更简单的XML配置 2.2.3. 可扩展的XML编写 2.2.4. Annotation(注解)驱动配置 2.2.5. 在classpath中自动搜索组件...
- **配置工具**:使用 Hibernate 和 Spring 配置工具进行数据库操作,确保数据层的稳定可靠。 #### 2.3 实现业务逻辑 - **DAO 层**:通过 DAO 设计模式来实现数据访问对象,从而分离业务逻辑和数据访问逻辑。 - **...
主要包括Java Web开发环境、JSP语法、JSP内置对象、Java Bean技术、Servlet技术、EL与JSTL标签库、数据库应用开发、初识Struts2基础、揭密Struts2高级技术、Hib锄劬e技术入门、Hibernate高级应用、Spring核心之IoC、...
{2.6}多态}{53}{section.2.6} {2.7}Sample code}{54}{section.2.7} {2.8}框架中移动的小球}{59}{section.2.8} {2.9}抽象与接口}{59}{section.2.9} {2.10}访问控制}{60}{section.2.10} {2.10.1}类的属性}{60}{...
3.4 修改.xml文件加入Struts 2过滤器 Struts 2是一个流行的MVC框架,用于处理HTTP请求。需要在Web.xml配置文件中配置Struts 2的过滤器,确保请求能够正确路由到对应的Action。 通过以上步骤,你已经成功地搭建了SCM...