Have written a spring controller Get method and trying to call that with postman but getting error
Could not get any response
There was an error connecting to https://localhost:8081/MyPortal/shared?video0=14&video1=15.
Even when I try to debug, the call is not going to the controller method. Not sure what is happening.
Here is the controller code:
@Controller
public class SharedLinkController {
@Autowired
VideoService videoService;
@RequestMapping("/shared")
public ModelAndView getSharedVideo(HttpServletRequest request, HttpServletResponse response,
@RequestParam(value="video0", required=false) Long video0,
@RequestParam(value="video1", required=false) Long video1,
@RequestParam(value="video2", required=false) Long video2,
@RequestParam(value="video3", required=false) Long video3){
List<Lab> videos = new ArrayList<Lab>();
// some processing with video0, video1 etc....
ModelAndView model = new ModelAndView("index");
model.addObject("videos", videos);
return model;
}
}
And this is how am trying to call the API:
https://localhost:8081/MyPortal/shared?video0=14&video1=15
Am not trying to make it a RestController as I need to redirect the call to a webpage. Is there anything wrong with the code?
Please suggest.
/MyPortal?