Here is the code snippet from my AngularJs controller:
.when("/M:topicId", {templateUrl: "Mu", controller: "conMFs"})
app.controller('conMFs',function($scope,$routeParams){
$scope.otherId = $routeParams.topicId;
});
And this is my implementation in the 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;
Although I am successfully extracting the `topicId` value from my AngularJS page into the AngularJS controller using `$scope.otherId`, I am facing challenges passing this value to my Spring controller for redirecting to a new page.
What would be the best approach to resolve this issue?