`
yinghuayu1324117
  • 浏览: 67353 次
  • 性别: Icon_minigender_2
  • 来自: 保定
文章分类
社区版块
存档分类
文章列表
下载============================== 处理下载的类:org.apache.struts2.dispatcher.StreamResult == 属性 == String contentType = "text/plain";       String contentLength;String contentDisposition = "inline";    String inputName = "inputStream";        InputStream inputStream;         ...
Struts2学习笔记--上传下载  标签: =================================== 文件上传的原理:         表单元素的enctype属性指定的是表单数据的编码方式,该属性有3个值:        1) application/x-www-form-urlencoded:这是默认编码方式,它只处理表单域里的value属性值,采用这种编码方式的表单会将表单域的值处理成URL编码方式。        2) multipart/form-data:这种编码方式的表单会以二进制流的方式来处理表单数据,这种编码方式会把文件域指定文件的内容也封装到请 ...
1、Aop的理解 Aop是Spring的两大核心概念之一 Aop就是在不改变源码的情况下添加新的属性和方法 2、Aop的概述 Aop是一种不同于oop(面向对象编程)的编程模式,它不是oop的替代,而是对oop的一种有益的补充
使用注解创建通知 前面讲了创建通知,现在用注解来创建通知 具体案例分析 public interface Service {     /**去公司*/     public
创建通知 Spring中通知的类型:前置通知Before、后置通知After、环绕通知Around、异常通知Throws、引入通知 Before:接口是org.springframework.aop.BeforeAdvice,在目标方法被调用之前调用 After:接口是org.springframework.aop.AfterReturningAdvice,在目标方法被调用之后调用 Around:接口是org.aopalliance.intercept.
注解、context和util的使用 @Autowired @PostConstruct @PreDestroy @Test 以上这都是注解 cn.csdn.service. Address
定制属性解析器 1、JavaBean的接口java.beans.PropertyEditor提供将字符串映射成非String类型的方法(其直接实现类为PropertyEditorSupport): 1)、getText( ):返回一个属性值的字符串 2)、setAsText(String text):将传递进来的字符串赋给Bean的属性
依赖检查 Spring中的Bean中有种依赖检查模式:none、simple、object、all 1、  none:不进行依赖检查 <?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:s ...
List     @Te public void testList(){ ApplicationContext ac = new ClassPathXmlApplicationContext("classpath:list.xml"); EmpServiceImpl empServiceImpl = (EmpServiceImpl) ac.getBean("empServiceImpl"); List<AddressServiceImpl> list = em ...
分散配置: 首先编写一个服务类 package cn.csdn.service; public class ConnServiceImpl { private String driverClass; private String url; private String user; private String password; //set注入 public void setDriverClass(String driverClass) { this.driverClass = driverClass ...
  Spring 自动装配 优点:自动装配能显著减少配置的数量。 Spring自动装配的5种模式:          可以使用bean元素的autowire属性来指定bean的装配模式:no、byName、byType、constructor、autodetect 一、No 在每个bean中都一个au
Bean常用的属性介绍   <bean  name=“xxx“ class=“指定的bean类“ scope=“singleton“></bean> 1、Id属性:java bean 在BeanFactory中的唯一标识,代码中通过BeanFactory获取JavaBean实例时需以此作为索引名称 2、Name属性:同id大致相同,如果给bean增加别名,可以通过
依赖注入 1、  什么是依赖? 依赖指的是类之间的访问关系。如果类A访问类B的属性或方法或者类A负责实例化类B,那么可以说类A依赖类B,和关联关系不同,无需把类B定义为类A的属性。在Spring中是通过注入来实现依赖关系的。 2、 
Spring中bean的生命周期 一个Bean从创建到销毁,如果是用BeanFactory来生成,管理Bean的话,会经历几个执行阶段: 1:Bean的建立:          有BeanFactory读取Bean定义文件,并生成各个Bean实例  2:属性注入:          执行相关的Bean属性依赖注入
IOC理解 使用IOC对象的依赖都是在对象创建是由负责协调系统中各个对象的外部实体提供的。 减少耦合的一个通常做法是具体实现隐藏在接口下,使得具体实现类的替换不会影响到引用类。 IOC也被称之为DI,是Spring的两大核心 ...
Global site tag (gtag.js) - Google Analytics