- 浏览: 152314 次
- 性别:
-
文章分类
最新评论
-
yjp:
效果丢失了,也好不了多少
SWT中使用JFreeChart(无需SWT_AWT) -
vfbrhvfbgd:
LZ,您好,
在网上找到了很多类似你这样的代码,请问您这 ...
一个使用SWT Ribbon代替Eclipse-RCP上面Coolbar的例子~ -
sdyjmc:
我也在看,发现Search不起作用。msn:sdyjmc@16 ...
读jlibrary代码的部分疑问,希望有人解答~ -
alaham:
jlibray研究得如何了呢?权限问题解决了吗?
我目前也正 ...
读jlibrary代码的部分疑问,希望有人解答~ -
bbiao:
你把代码抄错了,范型是不可以这么定义的....
这种模式我也 ...
从Hibernate范型DAO设计打造的自用DAO
一段来自ews.eclipse.technology.rap的关于Upload a file的代码
I impleted my File upload/download system with rap internal Browser + servlet.
upload dialog:
public class FileUploadDialog extends TitleAreaDialog { private Browser browser;
public FileUploadDialog(Shell parentShell) { super(parentShell); }
/** * Create contents of the dialog * @param parent */ @Override protected Control createDialogArea(Composite parent) { Composite area = (Composite) super.createDialogArea(parent); Composite container = new Composite(area, SWT.NONE); container.setLayout(new FillLayout()); container.setLayoutData(new GridData(GridData.FILL_BOTH));
browser = new Browser(container, SWT.NONE);
String url = "http://"+RWT.getRequest().getServerName()+":"+RWT.getRequest().getServerPort()+"/web/fileupload.jsp";
String html = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><html><head><title>upload file</title></head><body>"+
"<form action=\""+url+"\" enctype=\"MULTIPART/FORM-DATA\" method=\"post\"><br />File Name:</br><input type=\"file\""+
" name=\"filename\"/><br><input type=\"submit\" value=\"upload\"/></form></body></html> ";
browser.setText(html);
setMessage("select a local file");
return area;
}
/** * Return the initial size of the dialog */ @Override protected Point getInitialSize() { return new Point(382, 280); }
protected void configureShell(Shell newShell) { super.configureShell(newShell); newShell.setText("upload file"); }
}
file upload sevlet:
public class FileUploadServlet extends HttpServlet { private static final long serialVersionUID = -7245361228773015964L; private String uploadPath = "/upload/"; // server file repository private String tempPath = "/upload/tmp/"; //temp file folder
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
try {
DiskFileUpload fu = new DiskFileUpload();
// max file size fu.setSizeMax(-1);
// buffer size
fu.setSizeThreshold(4096);
// temp path
fu.setRepositoryPath(tempPath);
// get all uploa file List fileItems = fu.parseRequest(request); Iterator i = fileItems.iterator(); while (i.hasNext()) { FileItem fi = (FileItem) i.next(); // get the upload file name String fileName = fi.getName(); String sep = System.getProperty("file.separator"); int index = fileName.lastIndexOf(sep); if(index >-1){ fileName = fileName.substring(fileName.lastIndexOf(sep)); } fi.write(new File(uploadPath + fileName)); response.getWriter().println(fileName+"upload success"); } } catch (Exception e) { //do something? e.printStackTrace(); } } public void init() throws ServletException { if (!new File(uploadPath).isDirectory()) new File(uploadPath).mkdirs(); if (!new File(tempPath).isDirectory()) new File(tempPath).mkdirs(); } }
registe servlet:
public class HttpServiceTracker extends ServiceTracker {
public HttpServiceTracker(BundleContext context) { super(context, HttpService.class.getName(), null); }
public Object addingService(ServiceReference reference) {
final HttpService httpService = (HttpService) context
.getService(reference);
try {
//regist file upload servlet
HttpContext commonContext = new BundleEntryHttpContext(context
.getBundle(), fileFolder);
httpService.registerResources(fileContext, "/", commonContext);
Servlet adaptedJspServlet = new ContextPathServletAdaptor(
new FileUploadServlet(),
fileContext);
httpService.registerServlet(fileContext + "/fileupload.file",
adaptedJspServlet, null, commonContext);
} catch (Exception e) { e.printStackTrace(); } return httpService; }
public void removedService(ServiceReference reference, Object service) {
final HttpService httpService = (HttpService) service;
httpService.unregister(fileContext);
httpService.unregister(fileContext + "/fileupload.jsp");
super.removedService(reference, service);
}
}
start servlet:
add these code to the bundle start up method. public void start(BundleContext context) throws Exception { super.start(context); plugin = this; httpServiceTracker = new HttpServiceTracker(context); httpServiceTracker.open(); System.out.println("IM resource servlet started..."); }
这个实现是在RAP中使用Browser+servlet实现的文件上传功能;
其实在RAP的cvs上已经放出了org.eclipse.rwt.widgets.upload,专用于上传的组件,测试了一下,效果还不错,有进度条提示;不过在IE6下,有点难看了,在FF3下不能使用;
发表评论
-
来自网络上的经典文章收藏帖(不断增加中... ...)
2007-05-15 09:14 1061教你如何使用JFace创建Wizards Creating J ... -
RCP程序怎样实现自适应分辩率最大化(增加版)
2007-05-15 14:02 1355交口称赞在BLOG中提到了一种让RCP最大化的方法: 在App ... -
如何在ViewPart上添加ViewToolBar
2007-05-15 17:58 3825ViewToolBar其实就是Actions。在ViewPar ... -
郁闷的Perspective
2007-05-15 18:11 1014下午正式开始RCP开发,于是乎轻车熟路的开始打基础框架。 ... -
读jlibrary代码的部分疑问,希望有人解答~
2007-05-18 10:30 1360昨天在Bolg中贴出来一个很不错的RCP项目http://jl ... -
简单应用Maven2
2007-05-18 13:54 890Maven2对项目的管理确实可以说是无微不至的,而且给出了大量 ... -
介绍一个好站
2007-05-20 10:42 841http://www.krugle.com/代码搜索工具,使用 ... -
Eclipse3.3m7 VS Eclipse3.2.2
2007-05-22 08:37 1140Eclipse3.3m7 VS Eclipse3.2.2没有深 ... -
西安java用户群成立~_~
2007-05-23 15:58 843西安java用户群,感谢dudu,为我们开通团队,所有西安ja ... -
RCP的异常
2007-05-25 12:53 933上次的一篇文章问到为什么TreeViewer没有刷新, ... -
正在规划一个Eclipse上看RSS的Plugin
2007-06-04 08:50 996目前正在规划阶段,初步想法是,实现一个周博通的EclipseP ... -
初识DB4O
2007-06-10 11:15 768DB4O? 新出的OODBMS~取谐音DB fo ... -
如何用WebStart部署RCP应用程序?
2007-06-11 17:19 953上传一份同事写的预研文档:WebStartToRCP.doc ... -
RCP开发者的好去处之ICON系列(持续更新中... ...)
2007-06-11 20:49 911为了找个合适的图片是不是头大的不像样子了?OK,我现在 ... -
庆祝一下~RCP开发者的福音到了!
2007-06-14 22:04 874今天在Eclipse站上学习如何使用Maven2管理Eclip ... -
再次理解Eclipse的类加载机制
2007-06-18 15:13 1107今天在写RCP的基础运行插件的时候,发现一个非常有意思的问题: ... -
插件开发依赖其他插件时一定要注意!
2007-06-19 14:18 2274插件开发依赖其他插件时,我们要在plugin.xml的depe ... -
RCP实践之软件架构
2007-06-19 21:22 703RCP还是新兴的东西,大家都是用它做做小东东,所以在网 ... -
RCP实践之第三方JAR包
2007-06-20 21:43 3211感谢大家对上一篇文章的拍砖,引起的反响不小,目的达到了 ... -
RCP实践之安全模型
2007-06-21 21:52 1124感谢大家最近对本 ...
相关推荐
标题中的“ews.rar_EWS”很可能是指一个名为“EWS”的软件或库的源代码压缩包,其中“rar”是常见的压缩格式,用于打包多个文件。描述中提到的“ALSA driver for ICEnsemble ICE1712 (Envy24)”揭示了这个EWS项目与...
标题中的“ews.rar_DMX_EWS”表明这是一个与DMX(Digital Multiplexed Signal)和EWS(可能指的是Electronic Warfare System或类似系统)相关的压缩文件。这个文件集可能包含了用于编程或控制Terratec EWS88MT D、EW...
“board-rsi-ews.c”这个文件名暗示了这是一个C语言编写的源代码文件,它是Linux设备驱动程序的一部分,专门负责初始化RSI-EWS板卡。在Linux内核中,每个硬件设备都有对应的驱动程序,这些驱动程序通常包含了设备的...
evolution-ews-3.28.5-1.el7.x86_64.rpm
安卓发送Exchange邮件,引用ews-android-api.jar和joda-time-2.8.jar两个包。 用法: ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2); ExchangeCredentials credentials = new ...
EWS(Exchange Web Services)是微软Exchange Server提供的一种基于Web的接口,允许开发者通过编程方式访问和操作Exchange服务器上的邮箱、日历、联系人等数据。EWSJavaAPI_1.2.jar是针对Java开发者的EWS客户端库,...
在IT行业中,Exchange Web Services (EWS) API 是一种用于与Microsoft Exchange Server进行通信的编程接口,它允许开发者通过各种编程语言(如Java)来执行邮件管理、日历操作、联系人同步等任务。本教程将详细介绍...
基于印尼数字广播电视EWS技术规范详解
Java implementation of the Exchange Web Services (EWS) API. This API gives developers programmatic access to Exchange Server 2007 SP1 and above. exchange web services api,支持2007sp1以上的版本
EWS java API 里面包含 Java调用EWS 接口所需要的所有jar包如: commons-logging-1.2.jar joda-time-2.8.jar commons-lang3-3.4.jar httpclient-4.4.1.jar httpcore-4.4.1.jar
evolution-ews-3.28.5-6.el7.i686.rpm
EVOC 一体化工作站 EWS-844E.pdfpdf,EVOC 一体化工作站 EWS-844E.pdf
标题中的“evolution-ews-3.28.5-8.el7-9.x64-86.rpm.tar.gz”表明这是一个包含多个RPM包的压缩文件,适用于64位或86位架构的Linux系统。文件后缀名为.tar.gz,说明它经过了先压缩再归档的处理。这类文件通常用于...
EWS(Exchange Web Services)是Microsoft Exchange Server提供的一种API接口,允许开发者通过Web服务的方式与Exchange服务器进行交互,包括发送、接收、管理邮件以及访问日历、联系人等信息。在本文中,我们将深入...
标题“win8拇指输入”指的是在Windows 8操作系统中,为平板电脑用户设计的一种便捷的触摸屏输入方式,尤其适合使用拇指操作。Windows 8在设计时充分考虑了触控设备的需求,拇指输入就是其中一个重要特性,旨在提高在...
早期预警评分系统(Early Warning Score System, EWS)是一种用于评估患者临床状况的工具,它通过量化患者的一些基本生理指标来判断患者的健康状态,并据此提供相应的临床干预建议。EWS主要依据以下几个生理指标来...
EWS(Exchange Web 服务)客户端 用于连接以交换和检索日历和联系信息的库。 该库使用 NTLM 与交换服务器进行身份验证。 安装 '''npm 安装 ews''' 用法 var ews = require ( 'ews' ) ; var mailbox = 'email@...
资源分类:Python库 所属语言:Python 资源全名:suds-ews-0.3.7.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
我使用Exchange Web Service(EWS)的练习 作者:3gstudent 许可证:BSD 3-Clause 更多详细信息: 更新(2020.06.20): 添加新模式: CreateTestMail,创建测试邮件并将其保存到目标文件夹。 ...