dimanche 22 février 2015

Adding a new RequestMapping to kolorobot's spring-mvc-quickstart-archetype

I'm using the spring-mvc-quickstart-archetype by kolorobot to start a project using Spring (mostly to learn).


I can build and deploy to tomcat no problem. I've run into a roadblock very early though. I'm having a problem adding a new page. I've created the following class



package com.nobodyshero.classroom.about;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class AboutController {
@RequestMapping(value = "about")
public String about() {
return "about/about";
}
}


Under webapp, WEB-INF, views I've created a folder named "about" and put an "about.html" inside of it. I can't actually hit it. My web.xml is mostly empty as I understand it the annotations should handle the mapping automatically without me having to define them inside web.xml.


Aucun commentaire:

Enregistrer un commentaire