문제

We're having an issue where the values that we take in via @PathVariable or via binding under moderate load are getting assigned to the wrong variables.

For doing these tests we're always hitting the same URL's. Hitting the URL's slowly produce the correct results every time.

We're using Spring 3.0.5.RELEASE but have tired up to 3.1.2.RELEASE and still have the issue. We can't see anything else that's changed lately and we've had these services in production for over a year now and they seem to have just recently started throwing these.

Code Example for Binding:

 @RequestMapping(value = "config/selectItem")
public ModelAndView selectItem(@Valid selectItemCommand command, BindingResult bindResults) {
   if (!"test".equals(command.getName())
   {
     //Fails into here
     int i =0;

   }    
}

Code Example for Path Variables:

@RequestMapping(value = "config/selectItem/{name}",method = RequestMethod.GET)
public ModelAndView selectItem(@PathVariable("name") String name)
{
  if (!"test".equals(name))
  {
    //Fails into here
    int i = 0;
  }
}

I added a HttpServletRequest request to the parameter list and the URL that it shows has the correct values.

I totally forgot but we had this come up about a year ago and I had put in a ticket at the time that I thought had resolved it but has not. Spring MVC is dropping a @PathVariable

도움이 되었습니까?

해결책

It turns out that we implemented a StringTrimmerEditor incorrectly and it wasn't threadsafe.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top