一. In Spring Web Flow, a flow is defined by three primary elements: states, transitions,and flow data.如果把webflow当做是一次旅行,则state是旅途中每个景点,而transitions是连接景点的路径,data是在每个景点中购买的纪念品. 1.state (1)支持的状态 (2)view-state View states are used to display information…
States, transitions, and entire flows can be secured in Spring Web Flow by using the <secured> element as a child of those elements. For example, to secure access to a view state, you might use <secured> like this: <view-state id="rest…
一. 1.Wiring a flow executor <flow:flow-executor id="flowExecutor" /> Although the flow executor is responsible for creating and executing flows, it’s not responsible for loading flow definitions. That responsibility falls to a flow registr…
一.概述 1.Spring offers several options for configuring data-source beans in your Spring application, including these: Data sources that are defined by a JDBC driver Data sources that are looked up by JNDI Data sources that pool connections 2. 二.四种方…
1.spring扩展的jdbc异常 2.Template的运行机制 Spring separates the fixed and variable parts of the data-access process into two distinct classes: templates and callbacks. Templates manage the fixed part of the process,whereas your custom data-access code is hand…
一. 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()…
一.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…
一. What if you wanted to restrict access to certain roles only on Tuesday? Using the access() method, you can also use SpEL as a means for declaring access requirements. For example, here’s how you could use a SpEL expression to require ROLE_SPITTER…
一. 1.定义接口 Suppose that you need to authenticate against users in a non-relational database suchas Mongo or Neo4j. In that case, you’ll need to implement a custom implementationof the UserDetailsService interface. public interface UserDetailsService {…
一.LDAP server在哪 By default, Spring Security’s LDAP authentication assumes that the LDAP server is listening on port 33389 on localhost. But if your LDAP server is on another machine,you can use the contextSource() method to configure the location: @O…
一. 1.Focusing on the authentication query, you can see that user passwords are expected to be stored in the database. The only problem with that is that if the passwords are stored in plain text, they’re subject to the prying eyes of a hacker. But if…
一. 1.It’s quite common for user data to be stored in a relational database, accessed via JDBC . To configure Spring Security to authenticate against a JDBC -backed user store,you can use the jdbcAuthentication() method. The minimal configuration requ…
Spring Security is extremely flexible and is capable of authenticating users against virtually any data store. Several common user store situations—such as in-memory, relational database, and LDAP —are provided out of the box. But you can also create…
一.SpringSecurity的模块 At the least, you’ll want to include the Core and Configuration modules in your application’s classpath. Spring Security is often used to secure web applications, and that’s certainly the case with the Spittr application, so you’l…
No matter what happens, good or bad, the outcome of a servlet request is a servlet response. If an exception occurs during request processing, the outcome is still a servlet response. Somehow, the exception must be translated into a response. Spring…
一.什么是multipart The Spittr application calls for file uploads in two places. When a new user registers with the application, you’d like them to be able to provide a picture to associate with their profile. And when a user posts a new Spittle , they ma…
一.在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 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支持的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中定义…
一. Starting with Spring 3.0, Spring supports the Java Validation API in Spring MVC . No extra configuration is required to make Java Validation work in Spring MVC . You just need to make sure an implementation of the Java API , such as Hibernate Vali…