Spring 3 samples

Could you recommend me some web portals or sites where I can find good examples (or tutorials, screencasts) for the third version of Spring?

PS I am new to Spring (and java web frameworks). And now I choose the version of Spring to study (from 2.5 to 3). Which one would be better for me?

+3
source share
2 answers

Spring 3 Framework 3 Spring Reference Guide
Sample applause

Which one is best for me?

Latest version 3.0.5.RELEASE , find out her.

+3
source

http://www.vaannila.com/spring/spring-example/spring-example.html , ... , spring spring.

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>

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
+2

Source: https://habr.com/ru/post/1775799/


All Articles