I just started working with spring and set up a simple spring project in NetBeans. By default it doesn’t seem to use annotations.
In one of my controllers I’d like to handle different clicks on the form. I have looked at some solutions and it seems like adding a parameter check could work:
@RequestMapping(params = "someAction")
public ModelAndView doSomeAction() {
However it looks like all of the requests are going to:
public class SetupController implements Controller {
@Override
public org.springframework.web.servlet.ModelAndView handleRequest(
HttpServletRequest hsr, HttpServletResponse hsr1) throws Exception {
Is there a way I can achieve the same effect without RequestMapping annotation?
It seams that you mixed the old (implements Controller) style with the new one annotation based style.
You can’t (or at least should not) mix them, at least not for one class.
If you use Spring 3.x then I strongly recommend to use the Annotation based style.
To enable the Annotation Based style, you need at least this configuration settings: