Skip to content

Commit

Permalink
configure Spring MVC Controller
Browse files Browse the repository at this point in the history
  • Loading branch information
youhubs committed Jul 28, 2020
1 parent a7108f6 commit 9f79a9e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
12 changes: 12 additions & 0 deletions WebContent/WEB-INF/views/index.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Customer Manager</title>
</head>
<body>
<h1>${message}</h1>
</body>
</html>
17 changes: 17 additions & 0 deletions src/com/youhubs/customer/CustomerController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.youhubs.customer;

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

@Controller
public class CustomerController {

@RequestMapping("/")
public ModelAndView home() {
ModelAndView mv = new ModelAndView("index");
mv.addObject("message", "Hello from Spring MVC!");
return mv;
}

}

0 comments on commit 9f79a9e

Please sign in to comment.