spring
共 8 篇文章
DelegatingFilterProxy原理
DelegatingFilterProxy的原理及使用 DelegatingFilterProxy就是一个对于servlet filter的代理,用这个类的好处主要是通过Spring容器来管理servlet filter的生命周期,还有就是如果filter中需要一些Spring容器的实例,可以通过spring直接注入,另外读取一些配置文件这些便利的操作都可以通过Spring来配置实现。 DelegatingFilterProxy的使用方法, 首先在web.xml中配置: <filter> <filter-name>IpFilter</filter-name> <filter-class>or…
Spring 3.x MVC 入门4 -- @ResponseBody & @RequestBody【转】
@ResponseBody & @RequestBody http://www.cnblogs.com/zhaoyang/archive/2012/01/07/2315436.html 作用? @RequestBody 将 HTTP 请求正文插入方法中,使用适合的HttpMessageConverter将请求体写入某个对象。 @ResponseBody 将内容或对象作为 HTTP 响应正文返回,使用@ResponseBody将会跳过视图处理部分,而是调用适合HttpMessageConverter,将返回值写入输出流。 HttpMessageConverter接口 <mvc:annotati…
2013-01-08 11:39 · spring
spring中配置quartz
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> <bean id="emailN…
2012-10-08 18:41 · spring
spring读取多个配置文件
<bean id="systemProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean"> <property name="locations"> <list> <value>classpath:application-common.properties</value> <value>classpath:application.properties</value> </list> </property> </bean> <context:property-placeholder ign…
2012-09-25 13:58 · spring
spring配置文件载入
Spring配置文件的装载在Web.xml中配置: <!-- Spring ApplicationContext配置文件的路径,可使用通配符,多个路径用,号分隔 此参数用于后面的Spring Context Loader --> <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath*:/applicationContext.xml classpath*:/applicationContext-*.xml </param-value> </context-param> <!-…
2012-08-29 11:36 · spring
spring3配置文件中的context:property-placeholder/元素[转]
spring3配置文件中的context:property-placeholder/元素 1.有些参数在某些阶段中是常量 比如 :a、在开发阶段我们连接数据库时的连接url,username,password,driverClass等 b、分布式应用中client端访问server端所用的server地址,port,service等 c、配置文件的位置 2.而这些参数在不同阶段之间又往往需要改变 比如:在项目开发阶段和交付阶段数据库的连接信息往往是不同的,分布式应用也是同样的情况。 期望:能不能有一种解决方案可以方便我们在一个阶段内不需要频繁书写一个参数的值,而在不同阶段间又可以方便的切换参…
2012-06-14 14:27 · spring
Spring Security中的ACL
ACL即访问控制列表(Access Controller List),它是用来做细粒度权限控制所用的一种权限模型。对ACL最简单的描述就是两个业务员,每个人只能查看操作自己签的合同,而不能看到对方的合同信息。 一、准备数据库和aclService ACL所需的四张表,表结构见附录:附录 E, 数据库表结构。然后我们需要配置aclService,它负责与数据库进行交互。 CREATE TABLE `acl_sid` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `principal` tinyint(1) NOT NULL, `sid` varchar(…
2012-01-11 13:47 · spring · Spring · security acl
web项目怎么启动spring容器
1. 首先,在web.xml中配置spring的配置文件的位置 contextConfigLocation classpath:spring/spring-applicationContext.xml 注:context-param中定义的是application范围内的参数,存放在servletcontext中 2. 在web.xml中定义listener com.test.ApplicationContextListener ApplicationContextListener是org.springframework.web.context.ContextLoaderListener的子…
2012-01-04 17:28 · spring