
java
淡淡的蛋蛋
这个作者很懒,什么都没留下…
展开
-
@PathVariable 和 @RequestMapping
请求路径上有个id的变量值,可以通过@PathVariable来获取 @RequestMapping(value = "/page/{id}", method = RequestMethod.GET) @RequestParam用来获得静态的URL请求入参 spring注解时action里用到。简介:handler method 参数绑定常用的注解,我们根据他们处理转载 2014-10-13 14:04:53 · 603 阅读 · 0 评论 -
java的单例模式,为什么需要volatile
目前看了java并发的书,记录一下。对于java的单例模式,正确的代码应该为:public class TestInstance { private volatile static TestInstance instance; public static TestInstance getInstance() { //1 if (instance == n转载 2017-05-02 17:51:29 · 5199 阅读 · 6 评论