I have two views named hello.jsp and hello_new.jsp. Does it mean that I need to create two seperate controllers as
hello.java
@Controller
public class hello {
@RequestMapping("/hello_new")
public ModelAndView helloWorld() {
String message = "Hello World_new, Spring 3.0!";
System.out.println(message);
return new ModelAndView("hello", "message", message);
}
}
and hello_new.java
@Controller
public class Hello_new {
@RequestMapping("/hello_new")
public ModelAndView helloWorld() {
String message = "Hello World_new, Spring 3.0!";
System.out.println(message);
return new ModelAndView("hello_new", "message", message);
}
}
or is there any way creating a single controller can map this two views?