@Component
public class HelloView implements View {
@Override
public String getContentType() {
return "text/html";
}
@Override
public void render(Map<String, ?> map, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
httpServletResponse.getWriter().print("hello view ,time :" + new Date());
}
}
@Controller
@RequestMapping("/springmvc")
public class TestController {
@RequestMapping("/testView")
public String testView(){
System.out.println("testView");
return "helloView";
}
}