Last active
May 2, 2016 12:11
-
-
Save JensMeiners/5356d442c8ad5c785528b9689e7ec12c to your computer and use it in GitHub Desktop.
Simple Spring Setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> | |
<bean id="crawler" class="de.berlin.tu.Crawler"> | |
<property name="indexServer" value="somewhereimportant.tu-berlin.de"></property> | |
<property name="indexPort" value="9999"></property> | |
</bean> | |
<bean id="readerlist" class="java.util.ArrayList"> | |
<constructor-arg> | |
<list> | |
<ref bean="first" /> | |
<ref bean="second" /> | |
<ref bean="third" /> | |
</list> | |
</constructor-arg> | |
</bean> | |
<bean id="first" class="de.berlin.tu.rss.ConfigRSSReader"> | |
<constructor-arg name="author" value="dc:creator" /> | |
<constructor-arg name="desc" value="description" /> | |
<constructor-arg name="title" value="title" /> | |
<constructor-arg> | |
<list> | |
<value>http://www.firstrss.de</value> | |
<value>http://www.secondrss.de/rss/</value> | |
</list> | |
</constructor-arg> | |
</bean> | |
</beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring-context</artifactId> | |
<version>4.1.6.RELEASE</version> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static ApplicationContext context = new ClassPathXmlApplicationContext("config.xml"); | |
List<ConfigRSSReader> readerList = (List<ConfigRSSReader>) context.getBean("readerlist"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment