随笔分类 - Spring实战(第四版)
摘要:使用Spring对JAX-WS(Java API for Xml Web Service)把服务发布为Web服务并使用Web服务 使用场景:不同应用之间调用公共的获取账号信息的服务。 @WebService注解所标示的类被认为Web服务的端点。 @WebMethod注解所标注的方法被认为是操作。 1
阅读全文
摘要:1)声明导出服务(控制器) 2)将url请求映射到控制器上 2)将url请求映射到控制器上 来自为知笔记(Wiz)
阅读全文
摘要:1)导出Hessian服务 @Beanpublic HessianServiceExporter hessianServiceExporterSpittrService(SpittrService spittrService){ HessianServiceExporter exporter = n
阅读全文
摘要:RmiServiceExporter可以把任意Spring管理的bean发布到RMI服务。 package spittr.config;import org.springframework.context.annotation.Bean;import org.springframework.cont
阅读全文
摘要:表达式驱动的注解,包括@PreAuthorize、@PostAuthorize、@PreFilter、@PostFilter 将@EnableGloBalMethod-Security注解的prePostEnable属性设置为true,开启对上述注解的AOP 14.2.1表述方法访问规则 定义许可
阅读全文
摘要:RMI:使用Java标准的对象序列化,但难以穿透防火墙 Hessian(二进制)和Burlap(XML):使用http,很好的穿透防火墙,但使用私有的对象序列化,不适合复杂的对象。 Spring的HttpInvoker:上面两者的结合。 来自为知笔记(Wiz)
阅读全文
摘要:Spring Security提供了三种不同的安全注解: Spirng Security自带的@Secured注解;JSR-250的@RoleAllowed注解;表达式驱动的注解,包括@PreAuthorize、@PostAuthorize、@PreFilter、@PostFilter @Secur
阅读全文
摘要:@Cacheable:在执行方法前,现在缓存中查找。查到了返回结构,如果查不到执行方法。 @CachePut:不管如何都执行方法,然后将结果放到缓存中。 上面两个可以组合使用,@Cacheable用于fing方法,@CachePut用于save方法。当执行完save方法后将结果存到缓存中,在调用fi
阅读全文
摘要:package spittr.config;<!--more-->import net.sf.ehcache.CacheManager;import org.springframework.cache.annotation.EnableCaching;import org.springframewo
阅读全文
摘要:/**<!--more--> * 通过重载,配置如果通过拦截器保护请求 * @param http * @throws Exception */ @Override protected void configure(HttpSecurity http) throws Exception {// su
阅读全文
摘要:自定义的登录页 /** * 通过重载,配置如果通过拦截器保护请求 * @param http * @throws Exception */ @Override protected void configure(HttpSecurity http) throws Exception { //添加默认登
阅读全文
摘要:用户信息存储 /** * 通过重载,配置user-detail服务<!--more--> * @param auth * @throws Exception */ @Override protected void configure(AuthenticationManagerBuilder auth
阅读全文
摘要:Spring Security借助于一系列Servlet Filter来提供各种安全功能。 DelegatingFilterProxy是一个特殊的Servlet,它本身所做的工作并不多,只是将工作委托给 Javax.Servlet.Filter实现类,这个实现类作为一个<bean>注册在Spring
阅读全文
摘要:import org.springframework.web.bind.annotation.ControllerAdvice;<!--more-->import org.springframework.web.bind.annotation.ExceptionHandler;/** * @vers
阅读全文
摘要:基于Java的初始化器创建组件(Servlet、Filter),最简单的方式就是实现Spring的WebApplication-Initializer。 package spittr.config;<!--more-->import org.springframework.web.WebApplic
阅读全文
摘要:7.2.1配置multipart解析器: DispatcherServlet没有实现Multipart请求数据的功能。<!--more-->它将该任务委托给MultipartResolver接口的实现来处理。Spring3.1开始为我们提供了两个解析类:StandardServletMultipar
阅读全文
摘要:如果配置了多个视图解析器,没有指定顺序,可以使用按照返回的名字匹配 package spittr.config;<!--more-->import org.springframework.context.annotation.Bean;import org.springframework.conte
阅读全文
摘要:Spring MVC的校验 来自为知笔记(Wiz)
阅读全文
摘要:本章内容: 映射请求到Spring控制器 透明的绑定表单参数 校验表单提交 <!--more--> Spring MVC(模型model-视图view-控制器controller) 1.请求离开浏览器时,带着信息,url。 2.请求的第一站是DispatcherServlet前端控制器。Spring
阅读全文

浙公网安备 33010602011771号