Well, controller is calling every mapping twice it's not for a particular mapping that it's happening. So I've doubt whether it is something related to configuration.
I've two kind of url mappings so one is for /admin and one for /user.
Therefore I'm having two servlet-config files one is for /admin and /user and two
servlets have been configured as follows.
<servlet>
<servlet-name>mvc-admin</servlet-name>
<servlet-class>com.myapp.servlets.AdminServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>mvc-user</servlet-name>
<servlet-class>com.myapp.servlets.userServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
and have two controller one is adminController and other is userController.
and have mappings as follows:
in adminController:
@RequestMapping("/selectUser")
public ModelAndView admin(){
return new ModelAndView("/admin/getapplist","list", Application.getApplicationList());
}
in userController:
@RequestMapping("/showlist")
public ModelAndView user(UserForm form, ServletRequest request) {
ModelAndView modelAndView = new ModelAndView("/user/showlist");
modelAndView.addObject("list", Application.getApplicationList());
return modelAndView;
}
Thanks.