一. Spring offers two JSP tag libraries to help define the view of your Spring MVC web views. One tag library renders HTML form tags that are bound to a model attribute. The other has a hodgepodge of utility tags that come in handy from time to time.…
一.在Spring中使用thymeleaf的步骤 1.配置 In order to use Thymeleaf with Spring, you’ll need to configure three beans that enable Thymeleaf-Spring integration: A ThymeleafViewResolver that resolves Thymeleaf template views from logical view names A SpringTempl…
一. SPRING支持的GENERAL TAG LIBRARY 1. 二.用<s:message>和ReloadableResourceBundleMessageSource实现国际化 1.配置ReloadableResourceBundleMessageSource,它能it has the ability to reload message properties without recompiling or restarting the application. package spitt…
一.Spring支持的View Resolver 二.InternalResourceViewResolver Spring supports JSP views in two ways: InternalResourceViewResolver  Spring provides two JSP tag libraries, one for form-to-model binding and one providing general utility features. 1.在java中定义…
一. 1.定义TilesConfigurer.TilesViewResolver的bean 注意有tiles2和tiles3,这里使用tiles3 (1)java形式 package spittr.web; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.contex…
一.<s:url> <s:url>可以直接生成一个url或url变量,它会在href的基础上加上应用context 1. <a href="<s:url href="/spitter/register" />">Register</a> 如果应用的context是“spittr”,则会转换为 <a href="/spittr/spitter/register">Registe…
一. 1.Spring MVC provides several ways that a client can pass data into a controller’s handler method. These include  Query parameters Form parameters Path variables 二.以query parameters的形式给action传参数 1.传参数 @Test public void shouldShowPagedSpittles()…
一.JpaRepository 1.要使Spring自动生成实现类的步骤 (1)配置文件xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:…
一.注入EntityManagerFactory的方式 package com.habuma.spittr.persistence; import java.util.List; import javax.persistence.EntityManagerFactory; import javax.persistence.PersistenceUnit; import org.springframework.dao.DataAccessException; import org.springfr…
一.EntityManagerFactory的种类 1.The JPA specification defines two kinds of entity managers:  Application-managed—Entity managers are created when an application directly requests one from an entity manager factory. With application-managed entity manage…