在看本篇博客之前,希望您能先到http://xuanmeiku.taobao.com去转转,里面全是真皮炫美酷时尚女鞋,价格实惠!如果你看中了哪一款,可以加我qq1074992674,或者直接通过旺旺联系我!欢迎大家的骚扰!本人诚信经营,绝不做欺骗他人的事情!
本文主要通过一个完整的实例,运用Spring Batch对固定长格式文件的读写操作。实例延续前面的例子,读取一个含有四个字段(ID,NAME,AGE,SCORE),对读取的字段做简单的处理,然后输出到两外一个TXT文件中。
工程结构如下图:
applicationContext.xml前文已经叙述过,在此不做阐述。
本文核心配置文件batch.xml的内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<bean:beans xmlns="http://www.springframework.org/schema/batch"
xmlns:bean="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spr