- 浏览: 343443 次
- 性别:
- 来自: 成都
文章分类
- 全部博客 (97)
- 搜索引擎 (9)
- JAVA基础知识 (7)
- Struts (13)
- Spring (1)
- Hibernate (0)
- iBATIS (2)
- ExtJs (10)
- AJAX (0)
- Oracle (1)
- MSSQLSERVER (1)
- MySQL (0)
- Prototype (0)
- DWR (0)
- EJB (0)
- J2EE综合 (0)
- 算法 (1)
- WebServices (0)
- JMS (0)
- JavaMail (0)
- JMX (0)
- UML (0)
- Dojo (0)
- Acegi (2)
- 其他Html-XML等 (3)
- CSS (1)
- 其他开源项目 (0)
- 英语 (0)
- Web3D (24)
- FCKeditor (1)
- javascript 特效 (2)
最新评论
-
荷戟者:
如何实现的,是否可以想象一点
extjs实现左侧tab -
coconut_zhang:
怎么没人评论,吼吼。。
HTMLParser使用详解(4)- 通过Visitor访问内容 -
Sorry':
JDBC中处理存储过程的结果集的通用流程 -
Sorry':
计划将客户
JDBC中处理存储过程的结果集的通用流程 -
renhongchao:
very good!在csdn也看到相同的文章,莫非是同一人? ...
HTMLParser使用详解(3)- 通过Filter访问内容
xml 代码
- How do we upload files
- Edit Page Browse Space Add Page Add News
- Added by tm_jee, last edited by Ted Husted on Jan 28, 2007 (view change)
- You can obtain the MultipartRequestWrapper from the ServletActionContext or by utilizing the fileUpload interceptor. The fileUpload interceptor is preferred.
- Ask the ServletActionContext
- MultipartRequestWrapper multipartRequest = ((MultipartRequestWrapper)ServletActionContext.getRequest())
- The MultipartRequestWrapper provideds access methods such as getFiles, getFile, getContentType, hasErrors, getErrors, and so forth, so that you can process the file uploaded.
- Utilize the fileUpload Interceptor
- _Preferred_
- Ensure that {{fileUpload }} Interceptor is included in the Action's stack.
- The default stack already includes {{fileUpload }}.
- Ensure that the HTML form sets the enctype and specifies on or more file type inputs.
- <form name="myForm" enctype="multipart/form-data">
- <input type="file" name="myDoc" value="Browse ..." />
- <input type="submit" />
- </form>
- Ensure that the Action provides one or more fileUpload mutator methods, with names that correspond to name of the file type input.
- public void setMyDoc(File myDoc)
- public void setMyDocContentType(String contentType)
- public void setMyDocFileName(String filename)
- The Action may also provide the corresponding accessor methods.
- public File getMyDoc()
- public ContentType getMyDocContentType()
- public String getMyDocFileName()
- Handling multiple files
- When multiple files are uploaded by a form, the files are represented by an array.
- Given:
- <form name="myForm" enctype="multipart/form-data">
- <input type="file" name="myDoc" value="Browse File A ..." />
- <input type="file" name="myDoc" value="Browse File B ..." />
- <input type="file" name="myDoc" value="Browse File C ..." />
- <input type="submit" />
- </form>
- The Action class can define file handling methods that accept an array.
- public void setMyDoc(File[] myDocs)
- public void setMyDocContentType(String[] contentTypes)
- public void setMyDocFileName(String[] fileNames)
- The uploaded files can be handled by iterating through the appropriate array.
- Extra Information
- Property Default
- struts.multipart.parser Commons FileUpload
- struts.multipart.saveDir javax.servlet.context.tempdir as defined by container
- struts.multipart.maxSize Approximately 2M
- @see struts.properties
- @see org.apache.struts2.dispatcher.FilterDispatcher#doFilter(SerlvetRequest, ServletRepsonse, FilterChain)
- @see org.apache.struts2.dispatcher.DispatcherUtil#wrapRequest(HttpServletRequest, SerlvetContext)
- @see org.apache.struts2.dispatcher.multipart.MultipartRequestWrapper
- @see org.apache.struts2.interceptor.FileUploadInterceptor
发表评论
-
详解struts2中struts.properties
2007-10-25 00:17 2718Stru ... -
struts2的struts.properties配置文件详解
2007-10-24 23:55 2193struts.action.extension ... -
Struts 2 间接实现零配置
2007-10-19 11:41 1762所谓间接实现零配置,是指只要做些初始化的配置之后,在以后的开发 ... -
Parameters in configuration results
2007-10-10 17:12 1211Parameters in configura ... -
display dynamic or static images
2007-10-10 16:38 1622How can we display dynamic or s ... -
Struts2 验证器
2007-10-08 22:30 4358<validators> ... -
初涉Struts 2.0
2007-10-06 09:43 1187初涉Struts 2.0... -
Apache Struts 2 Plugin Registry
2007-10-03 17:25 2134Apache Struts 2 Plugin Registry ... -
Struts 2 官方
2007-10-03 17:22 11401Struts 2 官方: http://struts.apac ... -
struts2与spring2集成
2007-10-03 17:12 1226在Eclipse下建立一个Dynamic Web Applic ... -
struts2的struts.properties配置文件详解
2007-10-03 17:02 1158struts.action.extension ... -
Struts 2与AJAX(第三部分)
2007-10-03 16:53 1502Struts 2与AJAX(第三部分 ... -
Struts 2与AJAX(第二部分)
2007-10-03 16:52 1639在上一篇文章《Struts 2与AJAX(第一部分)》,我已经 ... -
Struts 2与AJAX(第一部分)
2007-10-03 16:51 1662Struts 2与AJAX(第一部分) 在当今——Web 2 ... -
struts2表单标签
2007-10-03 16:48 1625Form Tags ... -
Struts2 with logon
2007-10-03 16:45 1157关于此工程中的所有设置是承接前一篇文章Struts2介绍之使用 ... -
Struts2介绍之使用链接标签
2007-10-03 16:42 1862Web应用区别于普通的站点之处在于Web应用可以创建一个动态的 ... -
Strus 2的新表单标志的使用
2007-10-03 16:35 1156Struts 2为大家提供了不少常用的很酷的表单标志,简化了我 ... -
在Struts 2中实现文件上传
2007-10-03 16:33 1225实现原理 Struts 2是通过Commons FileUpl ... -
在Struts 2中实现IoC
2007-10-03 16:32 1055IoC(Inversion of Control,以 ...
相关推荐
藏经阁-How do we explore MENA market.pdf
The trick is to determine when to use the different parts of the brain, and to do this, we need to think harder (and smarter) about how we think. Jonah Lehrer arms us with the tools we need, ...
英语教学设计 - Lesson 2 How can we do 第一课时 本节课的教学目标是使学生初步学习有关做某事方法的英语表达,通过实际对话情境的模拟练习加深对单词的掌握,并为下节课的句型讲解做好铺垫。 一、知识点总览 * ...
How do humans sketch objects 一文的代码,结果不太准,没有文中说得好,有可能是特征提取这一步有问题,也有可能是训练的问题。 代码只对十类进行测试,详情可见博客...
How We Test Software at Microsoft
* How can we ______ an apple?:选择正确的句子结构 * How can she ______ it?:选择正确的句子结构 * We can draw it ______ a hat.:选择正确的介词 * He can ______ it.:选择正确的动词形式 * The cat ______ ...
Unit_3_How_do_you_get_to_school课件.ppt
【人教版九年级英语Unit 1 How can we become good learners知识点整理】 一、介词by的用法 1. 表示“通过,用(某种方式或手段)”,常接名词或动名词形式,回答how引导的问题。例如: - How does the boy ...
how we test software at microsoft, 英文版
how do you do.py
—— How many bananas do we need? 2. 我们需要三只香蕉。 —— We need three bananas. 3. 我们需要多少酸奶? —— How much yogurt do we need? 4. 我们需要一杯酸奶。 —— We need a cup of yogurt. 5. 我们...
这篇PPT课件是针对英语新目标八年级上册Unit "How do you get to school"的教学资源,旨在帮助学生学习和掌握与出行方式相关的词汇和表达。本单元的重点在于理解和运用与交通方式、时间和到达地点相关的英语句型。 ...
Unit 3 Lesson 16 How do you go to school练习题及答案.doc
文档“How Do You Do.doc”看似与IT行业不直接相关,但实际上,它提供了一个教育场景,涉及人际交往和语言学习,这些在IT行业的人际沟通和团队协作中同样重要。以下是从标题、描述和标签中提炼出的知识点,并展开...
小学英语 Lesson 2 How can we do 第二课时 教案(教学设计) 本次教学设计旨在帮助六年级学生掌握 Lesson 2 的主要知识点,包括复习单词、句型、tch/dge 读音等。教学过程分为七个环节,分别是导入新课、阅读、...
But How Do It Know
Unit 8 How do you make a banana milk shake练习题及答案13.doc
Big Data,A Revolution That Will Transform How We Live, Work, and Think,Viktor Mayer-Schönberger,Kenneth Cukier
This document presumptuously purports to explain how to do research . We give heuristics that may be useful in picking up the specific skills needed for research (reading, writing, programming) and ...
大数据技术的经典书籍,介绍了多个大数据分析的应用实例,目前已有中文版