Could you recommend me some web portals or sites, where I can find good examples (or tutorials, screencasts) for the third version of Spring?
P.S. I'm beginner in Spring (and in java web-frameworks). And now I'm choosing the version of Spring to learn (between 2.5 and 3). Which one would be best for me开发者_如何学运维?
Spring 3 Framework Reference Manual
Spring 3 Sample Apllications
Which one would be best for me?
Latest version is 3.0.5.RELEASE, learn it.
http://www.vaannila.com/spring/spring-example/spring-example.html I hope this will help you....before u go through this u must know some basics about spring here i give one sample program first u understand the spring flow.
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
class computer {
private String keyBoard;
public void setKeyBoard(String keyBoard) {
this.keyBoard = keyBoard;
}
public String getKeyBoard() {
return keyBoard;
}
}
public class A {
public static void main(String...args) {
BeanFactory factory = new XmlBeanFactory(new ClassPathResource("computer.xml"));
computer comp = (computer)factory.getBean("keyboard");
System.out.println(comp.getKeyBoard());
}
}
context.xml
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="keyboard" class="computer">
<property name="keyBoard" value="Dell"/>
</bean>
batch file to execute the program
cls
set CLASSPATH=.;E:\SpringPrograms\lib\commons-logging.jar;E:\SpringPrograms\lib\org.springframework.aop-3.0.2.RELEASE.jar;E:\SpringPrograms\lib\org.springframework.asm-3.0.2.RELEASE.jar;E:\SpringPrograms\lib\org.springframework.aspects-3.0.2.RELEASE.jar;E:\SpringPrograms\lib\org.springframework.beans-3.0.2.RELEASE.jar;E:\SpringPrograms\lib\org.springframework.context-3.0.2.RELEASE.jar;E:\SpringPrograms\lib\org.springframework.context.support-3.0.2.RELEASE.jar;E:\SpringPrograms\lib\org.springframework.core-3.0.2.RELEASE.jar;E:\SpringPrograms\lib\org.springframework.expression-3.0.2.RELEASE.jar;E:\SpringPrograms\lib\org.springframework.instrument-3.0.2.RELEASE.jar;E:\SpringPrograms\lib\org.springframework.instrument.tomcat-3.0.2.RELEASE.jar;E:\SpringPrograms\lib\org.springframework.jdbc-3.0.2.RELEASE.jar;E:\SpringPrograms\lib\org.springframework.jms-3.0.2.RELEASE.jar;E:\SpringPrograms\lib\org.springframework.orm-3.0.2.RELEASE.jar;E:\SpringPrograms\lib\org.springframework.oxm-3.0.2.RELEASE.jar;E:\SpringPrograms\lib\org.springframework.test-3.0.2.RELEASE.jar;E:\SpringPrograms\lib\org.springframework.transaction-3.0.2.RELEASE.jar;E:\SpringPrograms\lib\org.springframework.web-3.0.2.RELEASE.jar;E:\SpringPrograms\lib\org.springframework.web.portlet-3.0.2.RELEASE.jar;E:\SpringPrograms\lib\org.springframework.web.servlet-3.0.2.RELEASE.jar;E:\SpringPrograms\lib\org.springframework.web.struts-3.0.2.RELEASE.jar;
javac A.java
java A
精彩评论