这就是我在AngularJs控制器中的含义
.when("/MutualFriends:topicId", {templateUrl: "MutualFriends", controller: "conMFriends"})
app.controller('conMFriends',function($scope,$routeParams){
$scope.otherId = $routeParams.topicId;
});
这是我的Spring Controller
@RequestMapping(value="/controlerM", method = RequestMethod.GET)
public ModelAndView controlerM(HttpServletRequest request, HttpServletResponse response) throws Exception {
ModelAndView model = null;
session=request.getSession(true);
user = (User) session.getAttribute("user");
List<ends1> ends=(List<ends1>) ifriendlistservice.getends(user.getId(),5);
session.setAttribute("MutualFriends", MutualFriends);
model = new ModelAndView("ends");
return model;
我能够从AngularJS控制器中的AngularJS页面获取topicId(使用$ scope.otherId),但是我无法将此值传递给我的Spring控制器,从我重定向到新页面。
请帮忙。