1. How to learn Spring? You can learn Spring through the following ways: (1) Spring Download Pack MVC-STEP-BY-STEP and SAMPLE directory in the Spring Directory are examples of preferred Spring development. (2) AppFuse integrates the current most popular lightweight lightweight framework or tools Ant, XDoclet, Spring, Hibernate (Ibatis), Junit, Cactus, Strutstestcase, Canoo's WebTest, Struts Menu, Display Tag Library, OSCache, JSTL, Struts. You can learn Spring through the AppFuse source code. AppFuse website: http://raibledesigns.com/wiki/wiki.jsp? Page = Appfuse (3) Spring Development Guide (Htttp://www.xiaxin.net/spring_dev_guide.rar) A spring entry Books, the concept of reverse control and dependency injections, as well as Spring Bean management, Spring's MVC, Spring, and Hibernte, IBATIs. (4) Spring Research Chinese Forum Springframework Chinese Forum (http://spring.jActiongroup.net) Spring section 2 of http://forum.javaeye.com, uses Spring framework programming, console prints Log4j : WARN PLEASE INITIALIZE THE LOG4J SYSTEM PROPERLY? Explain that your log4j.properties is not configured. Please put the log4j.properties in the ClassPath of the project, Eclipse's classpath is a bin directory, so you can put the log4j.properties in the SRC directory because the files in the SRC directory are copied to the bin directory. Here is an example of log4j.properties:
log4j.rootLogger = DEBUG, stdoutlog4j.appender.stdout = org.apache.log4j.ConsoleAppenderlog4j.appender.stdout.layout = org.apache.log4j.PatternLayoutlog4j.appender.stdout.layout.ConversionPattern =% d% 5p (% F: % L) -% M% N
3. Java.lang.noclassdeffounderror? Generally, because you don't put the necessary JAR packages into the lib. For example, you have to use Spring and Hibernate, you need hibernat.jar, aopalliance.jar, cglig.jar, Jakarta-Commons, in addition to Spring.jar. http://www.springframework.org/download.html Download Spring Development Pack, provide two zip packs Spring-framework 1.1.3-with-dependencies.zip and Spring-Framework-1.1.3.zip, I suggest you Download Spring-Framework 1.1.3-with-dependencies.zip. This zip decompression is more than one lib directory than the latter, where Hibernate, J2EE, DOM4J, AOPALLIANCE, JAKARTA-Commons, etc. are common packages. 4, java.io.filenotfoundexception: could not open class path resource [.... hbm.xml], prompt not to find an XML file? The reason is generally two: (1) The XML file is not in the ClassPath. (2) The XML name in ApplicationContext-Hibernate.xml does not have a package name. For example:
Then the definition of XML should be:
6. How to implement transaction management in Spring? First, if you use mysql, determine MySQL to the InnoDB type. The control of transaction management should be placed in the business logic layer. You can write a JavaBean that handles business logic, call DAO in the JavaBean, then incorporate the BEAN's method into Spring's transaction management. For example, the XML file is defined as follows:
String [] paths = { "com / yz / spring / dao / hibernate / applicationContext-hibernate.xml", "com / yz / spring / service / applicationContext-service.xml"}; ctx = new ClassPathXmlApplicationContext (paths);
8. How do I load ApplicationContext in web applications? You can automatically load by defining web.xml.
9. What is the LOG4J configured in Spring? Add the following code to Web.xml.
10, Spring framework introduced programming problem solved, how should I understand the Spring framework? These two books you should go see. These two books were written by Spring author rod johnson.
Expert One ON One J2EE Design and Developmentexpert One ON One J2EE Developments WITHOUT EJB
You should also look at Martinfowler's Inversion of Control Containers and The Dependency Injection Pattern.
http://www.martinfowler.com/articles/injection.html
A further study Spring documentation.
Http://www.jactiongroup.net/reference/html/index.html (Chinese version, unfinished translation)
There is also more practice.