欧美大片一区二区三区,性色av一区二区怡红,国产成人精品综合在线观看http://www.aygfsteel.com/mhl1003/category/46147.htmlzh-cnTue, 22 Jan 2013 14:12:02 GMTTue, 22 Jan 2013 14:12:02 GMT60Ext 上傳功能實(shí)現(xiàn)http://www.aygfsteel.com/mhl1003/articles/394198.html自由戰(zhàn)士自由戰(zhàn)士Mon, 14 Jan 2013 09:16:00 GMThttp://www.aygfsteel.com/mhl1003/articles/394198.htmlhttp://www.aygfsteel.com/mhl1003/comments/394198.htmlhttp://www.aygfsteel.com/mhl1003/articles/394198.html#Feedback0http://www.aygfsteel.com/mhl1003/comments/commentRss/394198.htmlhttp://www.aygfsteel.com/mhl1003/services/trackbacks/394198.htmlJS上定義上傳按鈕:
new Ext.Button({
 text : '上傳',
 iconCls : 'uploadIcon',
 handler : function() {
  var url = top.rootPath
    + "/public/extjs/mycomp/fileupload/upload.ou?method=uploadfile&linkId=-1";
  var dialog = new Ext.ux.UploadDialog.Dialog({
   id : 'uploadComp',
   url : url,
   title : '文件上傳__上傳過程中關(guān)閉窗口,不影響上傳',
   width : 450,
   height : 300,
   minWidth : 450,
   minHeight : 300,
   draggable : true,
   resizable : true,
   autoCreate : true,
   constraintoviewport : true,
   modal : true,
   post_var_name : 'mms',
   reset_on_hide : false,
   allow_close_on_upload : true, // 關(guān)閉上傳窗口是否仍然上傳文件
   upload_autostart : true
    // 是否自動上傳文件
   })

  dialog.show();
  //dialog.on('uploadsuccess', successfunc);

 }

后臺上傳功能實(shí)現(xiàn):

private void uploadfile(HttpServletRequest request,
        HttpServletResponse response){
      try {
      String json ="";
      String linkId = request.getParameter("linkId");
      if(linkId!=null && !linkId.equals("")){
    DiskFileItemFactory fac = new DiskFileItemFactory();
    ServletFileUpload upload = new ServletFileUpload(fac);
    List fileList = upload.parseRequest(request);
    Iterator iter = fileList.iterator();
    while(iter.hasNext()){
      FileItem fileItem = (FileItem)iter.next();
      if(!fileItem.isFormField()){
       String name = fileItem.getName();
                String fileSize = new Long(fileItem.getSize()).toString();
                if(name == null || name.equals("") || fileSize.equals("0"))
                       continue;
           
                String fileName = name.substring(name.lastIndexOf("\\")+1);
                   //存儲文件
                String suffix = name.substring(name.lastIndexOf(".")+1);
                String uuid = UUID.randomUUID().toString();
               // File saveFile = new File("d:\\upload\\"+uuid+"."+suffix);
              
                String staffId = LoginParams.getLoginStaff().getStaffId();
                String fileType = getFileType(suffix);
             
               
                //保存文件
                FileSystem hdfs = TThdfsHelper.getFileSystem();
 
          // 上傳文件到HDFS集群
           String path = TThdfsHelper.getFullPath("flowForm/2013/"+uuid+"."+suffix);
           InputStream input =  fileItem.getInputStream();
          //InputStream input = fileItem; // 輸入流,根據(jù)實(shí)際需要處理
           ActionResult uploadresult = hdfs.writeFile(path, input, true, true);
           TThdfsHelper.close(hdfs);
          
                FileVO fileVo = new FileVO();
                fileVo.setFileName(fileName);
                fileVo.setFileSize(fileSize);
                fileVo.setSuffix(suffix);
                fileVo.setUUID(uuid);
                fileVo.setFileType(fileType);
                fileVo.setStaffId(staffId);
                fileVo.setLinkId(linkId);
                int result = (Integer)BOCallProxy.executeBO("com.redsea.file.bo.FileBO",
                       "uploadFile", new Object[]{fileVo});
                if(uploadresult.getCode().equals(ActionResult.SUCCESS)){
                 json ="{'success':true,'message':'上傳成功'}" ;
                }else{
                 json ="{'success':false,'message':'上傳失敗'}" ;
                }
              
                
 
      }
     
    }
     JspUtil.writerPrint(response, json);
     }else{
        json ="{success:false,message:'缺少組件編碼'}";
        JspUtil.writerPrint(response, json);
     }
  // JspUtil.writerJsonPrint(response, json);
   
   
  } catch (FileUploadException e) {
   e.printStackTrace();
  } catch (Exception e) {
   e.printStackTrace();
  }
       
 }


 



]]>
MyEclipse 8.X安裝spket插件之安裝篇http://www.aygfsteel.com/mhl1003/articles/392972.html自由戰(zhàn)士自由戰(zhàn)士Fri, 14 Dec 2012 02:46:00 GMThttp://www.aygfsteel.com/mhl1003/articles/392972.htmlhttp://www.aygfsteel.com/mhl1003/comments/392972.htmlhttp://www.aygfsteel.com/mhl1003/articles/392972.html#Feedback0http://www.aygfsteel.com/mhl1003/comments/commentRss/392972.htmlhttp://www.aygfsteel.com/mhl1003/services/trackbacks/392972.html 

曹海峰個人博客

2010-11-22  16:13:21

原文鏈接

1665



1、下載spket
地址:http://spket.com/download.html,選擇Spket IDE 或Plugin下載.建議下載spket-1.6.18.jar即Spket  IDE,嫌麻煩的話可以直接跳到文末,里面有我在csdn中上傳的附件,本文所涉及的所有文件都在該附件下

2、安裝spket
a調(diào)出命令行窗口,執(zhí)行java -jar  spket-1.6.18.jar,稍等片刻會出現(xiàn)窗口,點(diǎn)“Next”即可(命令行窗口如何使用,怎么找到spket-1.6.18.jar的路徑我這里就不解釋了,哈哈,當(dāng)然jar文件的話你直接雙擊就ok了)

b選擇Eclipse Plugin以及MyEclipse 8 的安裝目錄下的common文件夾所在路徑,點(diǎn)“Next”

c跳出spket的安裝路徑選擇框,選擇路徑的原則是不要和MyEclipse的安裝路徑在一起,選好后,點(diǎn)擊“Next”即可安裝

d下載CreatePluginsConfig.zip,運(yùn)行CreatePluginsConfig.java,運(yùn)行前注意修改Main函數(shù)中spket的路徑,我的是C:\\spket\\eclipse\\plugins,運(yùn)行,會有一段輸出,把輸出的內(nèi)容追加到MyEclipse  8.5\configuration\org.eclipse.equinox.simpleconfigurator\bundles.info文件下

e重啟MyEclipse,我們就可以在preferences下看到spket了

spket-1.6.18.jar及CreatePluginsConfig.zip的下載地址:http://download.csdn.net/source/2851705



]]>
javascript中文亂碼解決方案http://www.aygfsteel.com/mhl1003/articles/390496.html自由戰(zhàn)士自由戰(zhàn)士Wed, 31 Oct 2012 01:36:00 GMThttp://www.aygfsteel.com/mhl1003/articles/390496.htmlhttp://www.aygfsteel.com/mhl1003/comments/390496.htmlhttp://www.aygfsteel.com/mhl1003/articles/390496.html#Feedback0http://www.aygfsteel.com/mhl1003/comments/commentRss/390496.htmlhttp://www.aygfsteel.com/mhl1003/services/trackbacks/390496.html
如果JavaScript在JS中的alert彈出的對話框出現(xiàn)中文亂碼則可以使用如下的方法

<script src="<%=request.getContextPath()%>/page/jsp/system/js/judgeusercode.js" charset="GBK" ></script>則alert不會彈出亂碼。

如果在ajax中要傳遞中文,如果服務(wù)器端以UTF-8接收的話

使用 var username=encodeURI(document.form1.username.value)進(jìn)行轉(zhuǎn)碼

且服務(wù)器端控制器加上request.setCharacterEncoding("UTF-8");

則可以解決中文亂碼的問題。

request.getContextPath()應(yīng)該是得到項(xiàng)目的名字,如果項(xiàng)目為根目錄,則得到一個"",即空的字條串。如果項(xiàng)目為abc, <%=request.getContextPath()% > 將得到abc。

]]>
主站蜘蛛池模板: 华阴市| 琼结县| 马关县| 皋兰县| 灵台县| 安达市| 临高县| 东光县| 仲巴县| 镇安县| 章丘市| 宜章县| 兴业县| 孟村| 夏河县| 元江| 崇左市| 保亭| 东海县| 中阳县| 调兵山市| 珲春市| 廉江市| 黄石市| 锡林郭勒盟| 大宁县| 东光县| 三原县| 瓮安县| 微山县| 宜兴市| 盐亭县| 望奎县| 拉萨市| 四子王旗| 衡山县| 正定县| 台州市| 永春县| 宁津县| 自治县|