Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我可以使用HTML作为SpringMVC的前端吗_Html_Spring Mvc - Fatal编程技术网

我可以使用HTML作为SpringMVC的前端吗

我可以使用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

我想知道这是否可行。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,
    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>