引用thymeleaf解析器编写静态页面html.

 

JSP 标准标签库(JSP Standard Tag Library,JSTL)是一个实现 Web应用程序中常见的通用功能的定制标记库集,

引用引用thymeleaf解析器做静态标签不会有JSP标签。

localhost先访问Controller

Spring 默认提供了多种视图解析器,比如,我们可以使用最常用解析器 InternalResourceViewResolver 来查找 JSP 视图(与之相对应的视图类为 InternalResourceView)。通常,一个视图解析器只能查找一个或多个特定类型的视图,在遇到 Spring 不支持的视图或者我们要自定义视图查找规则的情况下,我们就可以通过扩展 Spring 来自定义自己所需的视图解析器。目前,视图解析器都需要实现接口 org.springframework.web.servlet.ViewResolver, 它包含方法 resolveViewName,该方法会通过视图名查找并返回 Spring 视图对象。在 Spring 中,所有的视图类都需要实现接口 org.springframework.web.servlet.view.View,Spring 还提供了多个实现了 View 接口的抽象类,所以我们并不需要直接实现接口 View, 而是可以实现 Spring 所提供的抽象类。

<form action="init" th:object="${userBean}" method="post">

删除:

<table>

  <tr>

  <td><a th:href="@{delete?(userId=${userInfo.userId})}"> <span th:text="${userInfo.userId}"></span></a></td>

  <td><span th:text="${userInfo.userName}"></span></td>

 </tr>

 </table>

刷新:

 public String deleteLogin(UserBean userBean, Model model) {

   

    int result = helloWorldService.deleteUser(userBean);

    List<UserBean> refresh = helloWorldService.searchUser(userBean);

    model.addAttribute("list", refresh);

        return "login";

    }


你可能感兴趣的:(引用thymeleaf解析器编写静态页面html.)