91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡(jiǎn)介

導(dǎo)入數(shù)據(jù)的時(shí)候頁(yè)面進(jìn)度往往不夠友好,實(shí)現(xiàn)頁(yè)面刷新ajax進(jìn)度條,目前項(xiàng)目在用

資源截圖

代碼片段和文件信息

package?com.manage.action;

import?java.io.BufferedReader;
import?java.io.File;
import?java.io.FileNotFoundException;
import?java.io.FileReader;
import?java.io.IOException;
import?java.math.BigDecimal;
import?java.text.SimpleDateFormat;
import?java.util.Date;
import?java.util.HashMap;
import?java.util.Locale;
import?java.util.Map;
import?java.util.zip.GZIPInputStream;

import?javax.servlet.http.HttpServletRequest;
import?javax.servlet.http.HttpServletResponse;
import?javax.servlet.http.HttpSession;

import?org.apache.struts.action.ActionForm;
import?org.apache.struts.action.ActionForward;
import?org.apache.struts.action.ActionMapping;
import?org.apache.struts.actions.DispatchAction;
import?org.apache.struts.upload.FormFile;

import?com.boss.dao.BusinessDAO;
import?com.boss.dao.impl.BusinessDAOImpl;
import?com.manage.common.Constants;
import?com.manage.common.FunctionUtils;
import?com.manage.common.ZipUtil;
import?com.manage.form.ValuefileForm;

public?class?DigimpAction?extends?DispatchAction
{
private?static?int?count=0;//全局標(biāo)記是否為第一次調(diào)用
public?ActionForward?importData(ActionMapping?mapping?ActionForm?form
HttpServletRequest?request?HttpServletResponse?response)?throws?Exception
{
count=1;
ValuefileForm?valuefileForm?=?(ValuefileForm)?form;
FormFile?valuefile=valuefileForm.getValuefile();
//String?sDir?=?Constants.FilePath;??//定義錯(cuò)誤文件存放目錄。
int?savenum=0;
int?errnum=0;
int?filenum=0;
int?updnum=0;
BusinessDAO?dao=new?BusinessDAOImpl();
Map?map=setMap();

if(valuefile.getFileName().indexOf(“DigiFlow“)!=-1)
{
try
{
String?path?=?FunctionUtils.convertStringToISO(valuefileForm.getFilepath());
//String?fp=“C:/Tomcat5.5/file/“;
//path?=?fp?+?path.substring(0path.indexOf(“.gz“))+“.txt“;
path?=?Constants.FilePath?+?path.substring(0path.indexOf(“.gz“))+“.txt“;

//String?filepath?=?ZipUtil.unZip(path?Constants.FilePath);
//BufferedReader?br=new?BufferedReader(new?InputStreamReader(valuefile.getInputStream()));
GZIPInputStream?gzin=new?GZIPInputStream(valuefile.getInputStream());
ZipUtil.unZip(gzin?path);
log.info(“filepath=[“+path+“]“);
BufferedReader?br=new?BufferedReader(new?FileReader(path));
BufferedReader?br2=new?BufferedReader(new?FileReader(path));
String?line=““;
Map?fileFlagMap=new?HashMap();//在所有記錄都插入成功時(shí)插入文件標(biāo)識(shí)
int?totalSize?=?0;//?總數(shù)據(jù)的條數(shù)已導(dǎo)入數(shù)據(jù)條數(shù)=filenum
???? long?startTime?=?System.currentTimeMillis();//?開始導(dǎo)入的時(shí)間
???? //用文件流讀取文件總行數(shù)
???? while((line=br2.readLine())!=null)
{
???? if(line==null?||?line.trim().length()==0)
continue;
???? totalSize++;
}
???? HttpSession?session?=?request.getSession(false);
????????????if?(session.getAttribute(“TOTALSIZE“)??!=?null)?{
????????????????session.removeAttribute(“TOTALSIZE“);
????????????????session.setAttribute(“TOTALSIZE“?String.valueOf(totalSize-1));
????????????}else{
???????????? session.setAt

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----

?????文件??????14414??2010-04-17?16:56??數(shù)據(jù)導(dǎo)入與進(jìn)度條實(shí)現(xiàn)(java)\DigimpAction.java

?????文件???????4761??2010-04-17?16:56??數(shù)據(jù)導(dǎo)入與進(jìn)度條實(shí)現(xiàn)(java)\dimpImport.jsp

?????文件??????89088??2010-03-18?17:26??數(shù)據(jù)導(dǎo)入與進(jìn)度條實(shí)現(xiàn)(java)\【digiflow數(shù)據(jù)導(dǎo)入與實(shí)時(shí)進(jìn)度條】開發(fā)手冊(cè).doc

?????目錄??????????0??2011-03-21?14:14??數(shù)據(jù)導(dǎo)入與進(jìn)度條實(shí)現(xiàn)(java)

-----------?---------??----------?-----??----

???????????????108263????????????????????4


評(píng)論

共有 條評(píng)論

相關(guān)資源