BBYR Achieve
返回信息流
这是一条镜像帖。来源:北邮人论坛 / java / #28735同步于 2014/3/6
Java机器人发帖

关于spring的问题

Hov
2014/3/6镜像同步0 回复
以前没做过web service开发,最近按老师要求硬着头皮在学spring,看到官网的这个例子http://spring.io/guides/gs/accessing-twitter/ @EnableTwitter(appId="3se6dplpiWhqJjDOfM6iQ", appSecret="NJpQGWSpnQZ6KV58XOabtKdzWDCZtNQHqLC2yPnE") @EnableInMemoryConnectionRepository 上面这里应该是注入开发者需要使用的appId和secret,然后持久化。 @RequestMapping(method=RequestMethod.GET) public String helloTwitter(Model model) { if (connectionRepository.findPrimaryConnection(Twitter.class) == null) { return "redirect:/connect/twitter"; } model.addAttribute(twitter.userOperations().getUserProfile()); CursoredList<TwitterProfile> friends = twitter.friendOperations().getFriends(); model.addAttribute("friends", friends); return "hello"; } 然后这里是登录请求,实际中页面走向是connect/twitter->官网授权->connected/twitter->hello 但是我没看到例子里有讲述如何回到connected/twitter的步骤,这一块看不懂。 然后还有一部分是,这个登录同一时间只能保持一个人登录,其他人访问服务器的话,都是拿到第一个人的信息,应该怎样才能保证实现服务器实现各自信息获取,这里spring直接隐藏了accessToken的获取和登录,然后我接下来不会做了... (刚刚同学提醒了我一下,多线程,啊我真是太蠢了...去搜搜看看) 有没有学长来帮忙看看,或者给个例子之类的感激不尽啊
订阅后,新回复会通过你的通知中心匿名送达。
0 条回复
暂无回复 · 你可以订阅本帖等待新回复。