Skip to content

Instantly share code, notes, and snippets.

@A-pZ
Created December 1, 2015 15:45
Show Gist options
  • Save A-pZ/1c68edb2fb2e5f2208d7 to your computer and use it in GitHub Desktop.
Save A-pZ/1c68edb2fb2e5f2208d7 to your computer and use it in GitHub Desktop.
Springのproperty読み込み検証例。これだと特にばけない。
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"
default-autowire="byName"
>
<bean id="sample" class="lumi.sample.dto.SampleDTO">
<property name="mail" value="[email protected]"/>
</bean>
</beans>
public class SampleDTO {
@Getter @Setter
private String mail;
}
@Service
public class SampleService
@Autowired
private SampleDTO sample;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment