I have :
@Controller
@RequestMapping(value="admin/*", method=RequestMethod.GET)
public class AdminController {
@Autowired
private HttpServletRequest request;
@Autowired
private HttpServletResponse response;
@RequestMapping
public ResponseEntity<String> test0() {
System.out.println("ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ");
return null;
}
}
and the tag:
<mvc:annotation-driven />
in my config.xml
It should be enough I feel, but there is a problem with @Autowired:
No matching bean of type [javax.servlet.http.HttpServletResponse] found for dependency: expected at least 1 bean which qualifies ...
I have seen a couple of solutions mention setting up beans and such, but I am sure there has to be some better way. The annotation-scan should take care of this. It would suck if I have to set up beans in xml for several different annotations at different times. I just want the annotations to work when I use them!
I have seen: Spring MVC - Response
Thanks!