As far as I remember there nothing which changed drastically except an addition of one mapping.
Really know way to understand why controller is calling every mapping twice.
Is is something already faced in spring? I saw few posts on spring-forum n there it was happening because of empty img tag like .
I checked all my jsp pages n didn't find such an occurrence.
Anyway, we really can't be of any help without more information/code. We can't see what mappings you have, what your configuration is? Maybe you have two equal mappings.
Mark
Mahesh Bamane
Ranch Hand
Joined: Mar 12, 2008
Posts: 66
posted
0
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.
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());
Huh, where in Spring MVC do you have to create your own servlets? Spring MVC uses just one servlet the DispatcherServlet.
I highly recommend reading the Core Spring documentation, in the section on Spring MVC. Right now, you are over-complicating things and adding things that shouldn't be there, and therefore all bets are off of anything working in that environment.
Or here is a well written simple tutorial just to make one simple Controller with all configuration.