spring
sunxboy
这个作者很懒,什么都没留下…
展开
-
Spring MVC technology summary
1. accept Date params in a GET request to Spring MVC Controller@RequestMapping(value="/fetch" , method=RequestMethod.GET) public @ResponseBody String fetchResult(@RequestParam("from") @DateTim...原创 2014-07-11 15:32:50 · 102 阅读 · 0 评论 -
xml configuration of integration test with spring data mongo
1. junit test like below@RunWith(SpringJUnit4ClassRunner.class)@ContextConfiguration(locations = {"/spring/test-mongo-setup.xml"})public class AlarmLogDataHandlerTest extends AbstractDbDataTest...原创 2014-03-25 08:51:09 · 124 阅读 · 0 评论 -
Cascade Save for spring mongo data
1. we have some entities like below: AlarmLogs.javapackage com.eifesun.monitor.web.model;import static com.eifesun.monitor.DeviceType.fromValue;import static com.eifesun.monitor.inverte...原创 2014-03-25 08:56:26 · 145 阅读 · 0 评论 -
Spring 3中PropertySourcesPlaceholderConfigurer 嵌套解析用法
介绍下PropertySourcesPlaceholderConfigurer 的特别用法,比如要假设sa是默认的username的值的话,可以这样: <property name='username' value='${jdbc.username:sa}'/> 就是用冒号隔开了 另外一个特性为嵌套解析,比如: phase=qa jdbc.username.qa=...原创 2013-10-31 16:39:11 · 250 阅读 · 0 评论 -
spring data JPA的写法以及如何 测试
1。 pom 导入测试要用到的包 <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <scope>test</scope> </dependency> &原创 2015-05-22 10:33:34 · 571 阅读 · 0 评论 -
spring4 java.lang.ClassNotFoundException: java.lang.annotation.Repeatable 问题解决
最近做了一次spring版本的升级从3升级到4.突然报出java.lang.ClassNotFoundException: java.lang.annotation.Repeatable的错误 通过google找到如下解决方法:java.lang.annotation.Repeatable annotation that is the meta annotation used t...原创 2015-05-29 16:31:37 · 997 阅读 · 0 评论 -
配置动态读取(变化)文件 in Spring
1. 从环境变量中读取路径:<bean id="envPath" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> <property name="targetObject"> <!-- System.getProperties() -->..原创 2014-11-10 08:51:38 · 151 阅读 · 0 评论 -
Spring Data Mongo 自定义annoation
先show一下用法 @CreatedDate private DateTime createdDate; @LastModifiedDate private DateTime lastModifiedDate; @DBRef @CascadeSave private AlarmDetails alarmDetails;...原创 2014-12-19 12:21:39 · 183 阅读 · 0 评论