Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (...)
- <servlet>
- <servlet-name>TestingServlet</servlet-name>
- <servlet-class>TestingServlet</servlet-class>
- </servlet>
- <servlet-mapping>
- <servlet-name>TestingServlet</servlet-name>
- <url-pattern>/servlet/TestingServlet</url-pattern>
- </servlet-mapping>
- (...)
- @WebServlet(urlPatterns={"/path1","/path2"[,...],}
- @Controller
- public class HelloWorldController {
- @RequestMapping("/helloWorld")
- public ModelAndView helloWorld() {
- ModelAndView mav = new ModelAndView();
- mav.setViewName("helloWorld");
- mav.addObject("message", "Hello World!");
- return mav;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement