我可以使用HTML作为SpringMVC的前端吗
我想知道这是否可行。SpringMVC具有可以在UI中访问的模型对象,以访问服务器端数据 我的控制器中有以下内容我可以使用HTML作为SpringMVC的前端吗,html,spring-mvc,Html,Spring Mvc,我想知道这是否可行。SpringMVC具有可以在UI中访问的模型对象,以访问服务器端数据 我的控制器中有以下内容 I want to build an application using Spring MVC with front end as HTML, CSS and Jquery. 我的HTML代码如下 @Override protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpSe
I want to build an application using Spring MVC with front end as HTML, CSS and Jquery.
我的HTML代码如下
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request,
HttpServletResponse response) throws Exception {
ModelAndView model = new ModelAndView("HelloWorldPage");
model.addObject("msg", "hello world");
return model;
}
是的,你可以
-包含有关单个Spring项目和深入教程的所有信息
您还可以利用其他模板引擎(如Velocity和Thymeleaf)来创建更好、更流畅的HTML5页面
就我个人而言,我使用的是百里香
Spring 3 MVC+Thymeleaf教程-如果您的问题已得到回答,请标记为:)
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jstl/core">
<body>
<c:out value="${msg}"/>
</body>
</html>