Created
December 1, 2015 15:45
-
-
Save A-pZ/1c68edb2fb2e5f2208d7 to your computer and use it in GitHub Desktop.
Springのproperty読み込み検証例。これだと特にばけない。
This file contains hidden or 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" | |
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> |
This file contains hidden or 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 class SampleDTO { | |
@Getter @Setter | |
private String mail; | |
} |
This file contains hidden or 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
@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