Webwork is an excellent open source framework, especially its interceptor mechanism, I think it is the biggest highlight of the entire system, you can do a lot of articles on it, eclipse3.0.1 lomoz, database I use mysql4.0.12, Of course, I also used mysqlcc. The server I use Tomcat4.0.3 and Tomcat4.1, please download WebWork., Spring., Hibernate, put the JAR file in the lib directory of Web-INF. At the same time, please download http://unc.dl.sourceforge.net/source.zip, put the aopalliance.jar in the lib directory. There is also webwork2-spring.jar, as well as MySQL drivers to download and put it in Lib, shortness, then configuring log4j, if not properly configuring log, Tomcat will not form your project normally. Configuring log4j is very simple, establish a log4j.properties file under web-inf / class, as follows log4j.rootlogger = info, a1, r log4j.log4j.consolerappender log4j.consoleappender log4j.Appender.a1. Layout = org.apache.log4j.patternLayout log4j.Appender.a1.Layout.conversionPattern =% - D {yyyy-mm-dd hh: mm: s} [% C] - [% P]% m% n log4j.Appender .R = org.apache.log4j.RollingFileAppender log4j.appender.R.File = d: / Tomcat 4.1 / webapps / demo / logs / log4j.log log4j.appender.R.MaxFileSize = 100KB log4j.appender.R.MaxBackupIndex = 1 log4j.Appender.r.Layout = org.apache.log4j.patternLayout log4j.Appender.r.Layout.conversionPattern =% P% T% C -% M% n where the log4j.Appender.r.file This item follows Your Tomcat's installation location is modified, about the details of log4j, I recommend you to see Hilton's learning notes and related articles on IBM websites. Ok, start our webwork.
The first is to configure the web.xml file XML Version = "1.0"?>
author tijichen * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates * / public interface SystableDAO {public abstract void insert (Systable data);} then the implementation class package com .cz.struct; import net.sf. *; import org.springframework.orm.hibernate.support.HibernateDaoSupport; / ** * @author tijichen * * TODO to change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates * / public class SysTableDAOImp extends HibernateDaoSupport implements SystableDAO {. public void insert (systable data) {this.getHibernateTemplate () save (data);}} Why use interface class? Because Spring uses the dynamic agent of Java, about this part, you can see XIAXIN's Spring Guide In the Insert method, I directly call the Hibernate template method provided by Spring, it is convenient, then the Spring is configured, please in the web -LIB / Under the ApplicationContext.xml file, the content is as follows XML Version = "1.0" encoding = "UTF-8" - // Spring // DTD bean // en "http: //www.springframework.org/dtd/spring-beans.dtd ">
Propagation_required prop>