I noticed a common pattern is to put JSP pages in WEB-INF folder (as opposed to WAR root). What\'s the difference? Why is that preferred?
An extra-plus when using a Controller (or Front-Servlet) is that you decouple the URL path from the physical location of the JSP-files in your project.
As example here a simple request-mapping from a Spring Controller:
@RequestMapping(value = "/item/edit", method = RequestMethod.GET)
public String getItemEdit(@RequestParam(value = "id", required = false) final String id) {
return "itemeditform";
}
The ViewResolver takes care of mapping the URL to the place where your JSPs reside.