In Spring Framework 3.1.0, I have an annotated controller like this:
I have jackson-all-1.9.3.jar on the classpath.Code:@Controller public class RestAdministrationController { private UserDAO userDAO; public void setUserDAO(UserDAO userDAO) { this.userDAO = userDAO; } @RequestMapping( value="**/user", method=RequestMethod.GET) public @ResponseBody User getUser(@RequestParam("userid" ) String id ) { return userDAO.loadById(Long.parseLong(id)); } @RequestMapping(value="**/userlist", method=RequestMethod.GET) public @ResponseBody UserList getUserList() { return userDAO.list(); } }
The userlist method works as expected. http://localhost:8080/ebp2w/rest/adm...ation/userlist returns valid JSON.
http://localhost:8080/ebp2w/rest/adm...ion/user?foo=1 results in "The request sent by the client was syntactically incorrect ()" which is correct.
However http://localhost:8080/ebp2w/rest/adm.../user?userid=1 results in status 500 "The server encountered an internal error () that prevented it from fulfilling this request." There is no error recorded in the log4j log (which is set to level "debug"). Running the code in Eclipse indicates it is never reaching my method.
I have <mvc:annotation-driven/> and for some non-annotated controllers I have:
I have searched and cannot find any report of a similar problem. I have experimented with different parameter types on the method and using PathVariable instead of RequestParam but nothing seems to make a difference. I am out of ideas. Any suggestions please?Code:<bean id="handlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="interceptors"> <ref bean="localeChangeInterceptor" /> </property> <property name="mappings"> <value> /index.html=loginController /home.html=homeController /accessDenied.html=accessDeniedController /adminHome.html=adminHomeController </value> </property> </bean>


Reply With Quote
