利用SpringMVC上传文件,也可以一次上传多个文件。 上传多个文件的时候用MultipartFile[] file即可 页面表单
Upload a</p></div>
<div class="meta">
<a class="aut" data-avatar="https://static.open-open.com/img/avatar/privary/default.png" data-avatar="https://static.open-open.com/img/avatar/privary/default.png" data-name=" m4ed " data-id="471247" href="https://user.open-open.com/u/471247">
<img src="https://static.open-open.com/img/avatar/privary/default.png" width="24"> m4ed </a>
<span class="t"> <i class="fa fa-clock-o"></i> 2015-01-31 </span> <span class="number">2923 <i aria-hidden="true" class="fa fa-eye"></i></span> <span class="number">0 <i aria-hidden="true" class="fa fa-thumbs-o-up"></i></span>
<div class=" float-right ui-tags"> <a class="" href="/code/tag/springmvc.html">SpringMVC</a> </div>
</div>
</div>
</div>
<div class="item ut-pd10 ">
<div class="content ut-pl15">
<h2 class="header">
<a href="/code/view/1423558885014" target="_blank"> 使用<em>SpringMVC</em>上传文件</a>
<span class="con-type">代码段</span>
</h2>
<div class="description"><p>type="submit" value="upload" /> </form> </body> <em>springmvc</em>-servlet.xml <?xml version="1.0" encoding="UTF-8"</p></div>
<div class="meta">
<a class="aut" data-avatar="https://static.open-open.com/img/avatar/privary/default.png" data-avatar="https://static.open-open.com/img/avatar/privary/default.png" data-name=" gbd8 " data-id="472040" href="https://user.open-open.com/u/472040">
<img src="https://static.open-open.com/img/avatar/privary/default.png" width="24"> gbd8 </a>
<span class="t"> <i class="fa fa-clock-o"></i> 2015-02-10 </span> <span class="number">3738 <i aria-hidden="true" class="fa fa-eye"></i></span> <span class="number">0 <i aria-hidden="true" class="fa fa-thumbs-o-up"></i></span>
<div class=" float-right ui-tags"> <a class="" href="/code/tag/springmvc.html">SpringMVC</a> </div>
</div>
</div>
</div>
<div class="item ut-pd10 ">
<div class="content ut-pl15">
<h2 class="header">
<a href="/lib/view/open1409212397682.html" target="_blank"> <em>SpringMVC</em>整合Shiro</a>
<span class="con-type">经验</span>
</h2>
<div class="description"><p><em>SpringMVC</em>整合Shiro, Shiro是一个强大易用的Java安全框架,提供了认证、授权、加密和会话<em>管理</em>等功能。 第一步:配置web.xml <!-- 配置Shiro过滤器,先让Shiro过滤系统接收到的请求 --> </p></div>
<div class="meta">
<a class="aut" data-avatar="https://simg.open-open.com/show/41771eadd463a28f6b623f3d3775f8fe.jpg" data-avatar="https://simg.open-open.com/show/41771eadd463a28f6b623f3d3775f8fe.jpg" data-name=" jopen " data-id="37924" href="https://user.open-open.com/u/37924">
<img src="https://simg.open-open.com/show/41771eadd463a28f6b623f3d3775f8fe.jpg" width="24"> jopen </a>
<span class="t"> <i class="fa fa-clock-o"></i> 2014-08-28 </span> <span class="number">48035 <i aria-hidden="true" class="fa fa-eye"></i></span> <span class="number">0 <i aria-hidden="true" class="fa fa-thumbs-o-up"></i></span>
<div class=" float-right ui-tags"> <a class="" href="/lib/tag/springmvc.html">SpringMVC</a> <a class="" href="/lib/tag/shiro.html">Shiro</a> <a class="" href="/lib/tag/anquan-xiangguan.html">安全相关</a> </div>
</div>
</div>
</div>
<div class="item ut-pd10 ">
<div class="rank border ut-120-170">
<img class="lazy" src="https://static.open-open.com/img/wdfm.png" data-original="https://sdoc.open-open.com/image/.jpg" >
<span class="label ">P9</span> </div>
<div class="content ut-pl15">
<h2 class="header">
<a href="/doc/d3841411c4804aad871b83cf5e3068f0.html" target="_blank"><i class="fa fa-file-word-o" aria-hidden="true"></i> <em>SpringMVC</em>:上传与下载</a>
<span class="con-type">文档</span>
</h2>
<div class="description"><p><em>SpringMVC</em>:上传与下载 1、<em>springmvc</em>.xml必须配置: 2 WEB-INF/lib下必加入:commons-fileupload.jar与commons-io-1.4.jar二个文件</p></div>
<div class="meta">
<a class="aut" data-avatar="https://static.open-open.com/img/avatar/privary/default.png" data-avatar="https://static.open-open.com/img/avatar/privary/default.png" data-name=" windleolxq " data-id="143739" href="https://user.open-open.com/u/143739">
<img src="https://static.open-open.com/img/avatar/privary/default.png" width="24"> windleolxq </a>
<span class="t"> <i class="fa fa-clock-o"></i> 2012-10-16 </span> <span class="number">419 <i aria-hidden="true" class="fa fa-eye"></i></span> <span class="number">0 <i aria-hidden="true" class="fa fa-thumbs-o-up"></i></span>
<div class=" float-right ui-tags"> <a class="" href="/wenku/tag/spring-mvc.html">Spring MVC</a> <a class="" href="/wenku/tag/web-kuangjia.html">Web框架</a> </div>
</div>
</div>
</div>
<div class="item ut-pd10 ">
<div class="content ut-pl15">
<h2 class="header">
<a href="/lib/view/open1451554675464.html" target="_blank"> <em>SpringMVC</em>整合Shiro</a>
<span class="con-type">经验</span>
</h2>
<div class="description"><p>第一步:配置web.xml <!-- 配置Shiro过滤器,先让Shiro过滤<em>系统</em>接收到的请求 --> <!-- 这里filter-name必须对应applicationContext.xml中定</p></div>
<div class="meta">
<a class="aut" data-avatar="https://simg.open-open.com/show/41771eadd463a28f6b623f3d3775f8fe.jpg" data-avatar="https://simg.open-open.com/show/41771eadd463a28f6b623f3d3775f8fe.jpg" data-name=" jopen " data-id="37924" href="https://user.open-open.com/u/37924">
<img src="https://simg.open-open.com/show/41771eadd463a28f6b623f3d3775f8fe.jpg" width="24"> jopen </a>
<span class="t"> <i class="fa fa-clock-o"></i> 2015-12-31 </span> <span class="number">16885 <i aria-hidden="true" class="fa fa-eye"></i></span> <span class="number">0 <i aria-hidden="true" class="fa fa-thumbs-o-up"></i></span>
<div class=" float-right ui-tags"> <a class="" href="/lib/tag/spring-mvc.html">Spring MVC</a> <a class="" href="/lib/tag/web-kuangjia.html">Web框架</a> </div>
</div>
</div>
</div>
<div class="item ut-pd10 ">
<div class="content ut-pl15">
<h2 class="header">
<a href="/blog/5035945760070083172.html" target="_blank"> <em>SpringMVC</em>中@ResponseBody的问题</a>
<span class="con-type">博客</span>
</h2>
<div class="description"><p>在<em>SpringMVC</em>中可以在Controller的某个方法上加@ResponseBody注解,表示该方法的返回结果直接写入HTTP response body中。 但是实际使用中发现最后生成的resp</p></div>
<div class="meta">
<a class="aut" data-avatar="https://simg.open-open.com/show/19b17023a9a69f94fa3a624e2fa04cf7.jpg" data-avatar="https://simg.open-open.com/show/19b17023a9a69f94fa3a624e2fa04cf7.jpg" data-name=" netloser " data-id="124" href="https://user.open-open.com/u/124">
<img src="https://simg.open-open.com/show/19b17023a9a69f94fa3a624e2fa04cf7.jpg" width="24"> netloser </a>
<span class="t"> <i class="fa fa-clock-o"></i> 2011-01-20 </span> <span class="number">29280 <i aria-hidden="true" class="fa fa-eye"></i></span> <span class="number">0 <i aria-hidden="true" class="fa fa-thumbs-o-up"></i></span>
<div class=" float-right ui-tags"></div>
</div>
</div>
</div>
<div class="item ut-pd10 ">
<div class="content ut-pl15">
<h2 class="header">
<a href="/lib/view/open1402968609122.html" target="_blank"> <em>SpringMVC</em> 流程分析</a>
<span class="con-type">经验</span>
</h2>
<div class="description"><p><em>SpringMVC</em> 流程 服务器启动阶段( DispatcherServlet 初始化阶段) 启动后 ContextLoaderListener 首先会在初始化方法 contextInitiali</p></div>
<div class="meta">
<a class="aut" data-avatar="https://simg.open-open.com/show/41771eadd463a28f6b623f3d3775f8fe.jpg" data-avatar="https://simg.open-open.com/show/41771eadd463a28f6b623f3d3775f8fe.jpg" data-name=" jopen " data-id="37924" href="https://user.open-open.com/u/37924">
<img src="https://simg.open-open.com/show/41771eadd463a28f6b623f3d3775f8fe.jpg" width="24"> jopen </a>
<span class="t"> <i class="fa fa-clock-o"></i> 2014-06-17 </span> <span class="number">39699 <i aria-hidden="true" class="fa fa-eye"></i></span> <span class="number">0 <i aria-hidden="true" class="fa fa-thumbs-o-up"></i></span>
<div class=" float-right ui-tags"> <a class="" href="/lib/tag/springmvc.html">SpringMVC</a> <a class="" href="/lib/tag/spring-mvc.html">Spring MVC</a> <a class="" href="/lib/tag/web-kuangjia.html">Web框架</a> </div>
</div>
</div>
</div>
<div class="item ut-pd10 ">
<div class="content ut-pl15">
<h2 class="header">
<a href="/lib/view/open1398827050437.html" target="_blank"> <em>springMVC</em>整合Freemarker例子</a>
<span class="con-type">经验</span>
</h2>
<div class="description"><p>freemarker是Java模板引擎 <em>springmvc</em>的搭建流程就不详细讲解了,需要的同学可以看我之前的博文。 这次主要分享的是:<em>springMVC</em>整合Freemarker 需要的Jar包:</p></div>
<div class="meta">
<a class="aut" data-avatar="https://simg.open-open.com/show/41771eadd463a28f6b623f3d3775f8fe.jpg" data-avatar="https://simg.open-open.com/show/41771eadd463a28f6b623f3d3775f8fe.jpg" data-name=" jopen " data-id="37924" href="https://user.open-open.com/u/37924">
<img src="https://simg.open-open.com/show/41771eadd463a28f6b623f3d3775f8fe.jpg" width="24"> jopen </a>
<span class="t"> <i class="fa fa-clock-o"></i> 2014-04-30 </span> <span class="number">116281 <i aria-hidden="true" class="fa fa-eye"></i></span> <span class="number">0 <i aria-hidden="true" class="fa fa-thumbs-o-up"></i></span>
<div class=" float-right ui-tags"> <a class="" href="/lib/tag/spring-mvc.html">Spring MVC</a> <a class="" href="/lib/tag/web-kuangjia.html">Web框架</a> <a class="" href="/lib/tag/freemarker.html">FreeMarker</a> <a class="" href="/lib/tag/springmvc.html">SpringMVC</a> </div>
</div>
</div>
</div>
<div class="item ut-pd10 ">
<div class="rank border ut-120-170">
<img class="lazy" src="https://static.open-open.com/img/wdfm.png" data-original="https://sdoc.open-open.com/image/9deeb5e7ae74fa7d1966e4324792e585_thumb.jpg" >
<span class="label ">P5</span> </div>
<div class="content ut-pl15">
<h2 class="header">
<a href="/doc/09061e9b5fcb444b995a05d1b15d65ce.html" target="_blank"><i class="fa fa-file-word-o" aria-hidden="true"></i> <em>SpringMVC</em> - MethodNameResolver(HelloWorld)</a>
<span class="con-type">文档</span>
</h2>
<div class="description"><p> 我们简要给出了使用Springmvc的一个入门源代码,及简要介绍工作流程。上一文档我们只实现了一个LoginActionController控制器,控制器内只有一个方法,往往我们实际项目内,一个控制器内会有N多个方法,一个请求对应某个控制器内的某一个方法,我们现在来实现一个控制器内多个方法的情况。 </p></div>
<div class="meta">
<a class="aut" data-avatar="https://static.open-open.com/img/avatar/privary/default.png" data-avatar="https://static.open-open.com/img/avatar/privary/default.png" data-name=" r_s " data-id="46298" href="https://user.open-open.com/u/46298">
<img src="https://static.open-open.com/img/avatar/privary/default.png" width="24"> r_s </a>
<span class="t"> <i class="fa fa-clock-o"></i> 2013-06-19 </span> <span class="number">532 <i aria-hidden="true" class="fa fa-eye"></i></span> <span class="number">0 <i aria-hidden="true" class="fa fa-thumbs-o-up"></i></span>
<div class=" float-right ui-tags"> <a class="" href="/wenku/tag/spring-mvc.html">Spring MVC</a> <a class="" href="/wenku/tag/web-kuangjia.html">Web框架</a> </div>
</div>
</div>
</div>
</section>
<div class="usage-search clearfix">
<h2 class="" aria-label=""><strong>SpringMVC权限管理系统</strong> 的相关搜索</h2>
<div >
<ul class="float-left">
<li><a href="https://www.open-open.com/search/?kw=JavaScript" ><em>Java</em>Script</a></li> <li><a href="https://www.open-open.com/search/?kw=JavaScript教程" ><em>Java</em>Script教程</a></li> <li><a href="https://www.open-open.com/search/?kw=JavaScript、jQuery、HTML5、Node.js实例大全" ><em>Java</em>Script、jQuery、HTML5、Node.js实例大全</a></li> <li><a href="https://www.open-open.com/search/?kw=Java开发-open开源文档" ><em>Java</em>开发-open开源文档</a></li> <li><a href="https://www.open-open.com/search/?kw=深入理解Java虚拟机" >深入理解<em>Java</em>虚拟机</a></li></ul> <ul class="float-left"> <li><a href="https://www.open-open.com/search/?kw=JavaScript中Array方法的正确打开方式" ><em>Java</em>Script中Array方法的正确打开方式</a></li> <li><a href="https://www.open-open.com/search/?kw=JavaScript进阶学习" ><em>Java</em>Script进阶学习</a></li> <li><a href="https://www.open-open.com/search/?kw=JavaScript动态创建多个div" ><em>Java</em>Script动态创建多个div</a></li> <li><a href="https://www.open-open.com/search/?kw=Java开发" ><em>Java</em>开发</a></li> <li><a href="https://www.open-open.com/search/?kw=JavaScript�հ�" ><em>Java</em>Script�հ�</a></li> </ul>
</div>
</div>
<div class="ui-pagination clearfix"> <a href=https://www.open-open.com/search/?kw=SpringMVC%E6%9D%83%E9%99%90%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F&page=4 class='pg-pre'><i class='fa fa-angle-left'></i></a> <a href=https://www.open-open.com/search/?kw=SpringMVC%E6%9D%83%E9%99%90%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F&page=1>1</a> <a href=https://www.open-open.com/search/?kw=SpringMVC%E6%9D%83%E9%99%90%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F&page=2>2</a> <a href=https://www.open-open.com/search/?kw=SpringMVC%E6%9D%83%E9%99%90%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F&page=3>3</a> <a href=https://www.open-open.com/search/?kw=SpringMVC%E6%9D%83%E9%99%90%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F&page=4>4</a> <strong>5</strong> <a href=https://www.open-open.com/search/?kw=SpringMVC%E6%9D%83%E9%99%90%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F&page=6>6</a> <a href=https://www.open-open.com/search/?kw=SpringMVC%E6%9D%83%E9%99%90%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F&page=7>7</a> <a href=https://www.open-open.com/search/?kw=SpringMVC%E6%9D%83%E9%99%90%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F&page=8>8</a> <a href=https://www.open-open.com/search/?kw=SpringMVC%E6%9D%83%E9%99%90%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F&page=9>9</a> <a href=https://www.open-open.com/search/?kw=SpringMVC%E6%9D%83%E9%99%90%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F&page=10>10</a> <a href=https://www.open-open.com/search/?kw=SpringMVC%E6%9D%83%E9%99%90%E7%AE%A1%E7%90%86%E7%B3%BB%E7%BB%9F&page=6 class='pg-next'><i class='fa fa-angle-right'></i></a> </div>
</div>
<div class="col-md-3">
<div class=" ui-box ut-pd20">
<div class="title"><h3>关键词</h3></div>
<p class="tags mt10"> <a class="" href="/wenku/?tags=Java">Java</a> <a class="" href="/wenku/?tags=项目管理">项目管理</a> <a class="" href="/wenku/?tags=LogicalDOC">LogicalDOC</a> <a class="" href="/wenku/?tags=OpenLaunch">OpenLaunch</a> <a class="" href="/wenku/?tags=Basic">Basic</a> <a class="" href="/wenku/?tags=Kubernetes">Kubernetes</a> <a class="" href="/wenku/?tags=DoraCMS">DoraCMS</a> <a class="" href="/wenku/?tags=WCP">WCP</a> <a class="" href="/wenku/?tags=UML建模">UML建模</a> <a class="" href="/wenku/?tags=软考相关">软考相关</a> </p>
</div>
</div>
</div>
</div>
</div>
</div>
<footer >
<div class="container py-5">
<div class="row">
<div class="col-md-3">
<h5>社区</h5>
<div class="row"><div class="col-md-6"><a class="text-muted" href="/project/">项目</a></div><div class="col-md-6"><a class="text-muted" href="/solution/">问答</a></div><div class="col-md-6"><a class="text-muted" href="/wenku/">文库</a></div><div class="col-md-6"><a class="text-muted" href="/code/">代码</a></div><div class="col-md-6"><a class="text-muted" href="/lib/">经验</a></div><div class="col-md-6"><a class="text-muted" href="/news/">资讯</a></div></div>
<ul class="list-unstyled text-small ut-mt20"><li><a class="text-muted" title=" 安卓开发专栏" target="_blank" href="http://www.open-open.com/lib/list/177">安卓开发专栏</a></li><li><a class="text-muted" href="http://www.open-open.com/lib/tag/开发者周刊" target="_blank" rel="tag">开发者周刊</a></li><li><a class="text-muted" href="http://www.open-open.com/lib/view/open1475497562965.html" target="_blank" rel="tag">Android Studio 使用推荐</a></li><li><a class="text-muted" href="http://www.open-open.com/lib/view/open1475497355674.html" target="_blank" rel="tag">Android开发推荐</a></li></ul>
</div>
<div class="col-md-3">
<h5>帮助中心</h5>
<ul class="list-unstyled text-small"><li><a class="text-muted" href="/upload.html">文档上传须知</a></li></ul>
<h5>关于我们</h5>
<ul class="list-unstyled text-small"><li><a class="text-muted" href="/about.html">关于深度开源</a></li><li><a class="text-muted" href="/duty.html">免责声明</a></li><li><a class="text-muted" href="/contact.html">联系我们</a></li></ul>
</div>
<div class="col-md-6 text-center"><img class=center-block src="https://static.open-open.com/img/logo01.svg" width=190px alt="深度开源"><small class="d-block mb-3 text-muted ut-mt40">© 2006-2019 深度开源 —— 开源项目,开源代码,开源文档,开源新闻,开源社区 杭州精创信息技术有限公司 <br/><br/><img src="https://static.open-open.com/img/beian.png"/><a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=33018302001163"> 浙公网安备 33018302001163 号</a> <a target="_blank" href="https://beian.miit.gov.cn">浙ICP备09019653号-31</a></small></div>
</div>
</div>
</footer>
<div id="fTools"><span id="gotop"> <i class="fa fa-arrow-up" aria-hidden="true"></i> </span><span id="feedback" title="建议反馈"> <i class="fa fa-inbox" aria-hidden="true"></i></span></div> <script type="text/javascript" src="https://static.open-open.com/js/lib.js?v=1.02"></script>
<script type="text/javascript" src="https://static.open-open.com/assets/popper.min.js"></script>
<script src="https://static.open-open.com/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://static.open-open.com/js/base.js?v=1.02"></script>
<script type="text/javascript" src="https://static.open-open.com/js/jq-plug.js?v=1.02"></script>
<script>
$(function () {
JC.reminderPop();//弹出用户信息
// JC.messagesPop();
//JC.getNotice(); //动态广播
$(".link-login").click(function(){ JC.lORr('login'); });
$("#topSearch").searchInit();
//用户登录状态
JC.setLogin(false);
});
</script>
<!-- JavaScript at the bottom for fast page loading -->
<script>
//index
$(function () {
function GetUrlParms() {
var args = new Object();
var query = location.search.substring(1);//获取查询串
var pairs = query.split("&");//在逗号处断开
for (var i = 0; i < pairs.length; i++) {
var pos = pairs[i].indexOf('=');//查找name=value
if (pos == -1) continue;//如果没有找到就跳过
var argname = pairs[i].substring(0, pos);//提取name
var value = pairs[i].substring(pos + 1);//提取value
args[argname] = decodeURI(value);//存为属性
}
return args;
}
var channel = ["all","learn","enjoy","resource","doc","solution","ppt", "", "", "pdf", "project", "lib", "code", "news", "blog"],
args = new Object(), url = "https://www.open-open.com/search/", kw = "", t = 0, page = 1, channelList=$(".all-sort-list");
args = GetUrlParms();
if (args["kw"] != undefined) {kw = args["kw"].replace(/\+/g,' ').replace(/(^\s*)|(\s*$)/g, "");}
if (args["page"] != undefined) {page = args["page"];}
if (args["t"] != undefined) {t = parseInt(args["t"]);}
$('.'+channel[t]).addClass("active");
$("#search-form input[name=t]").val(t);
function goto(t) {return (t==0)?url+ "?kw="+kw:url+ "?kw="+kw+"&t="+t;}
$('.tab').click(function () {
window.location = goto($(this).data('t'))
});
$('#search-form .close').click(function () {
$("#search-form input[name=kw]").val('').focus();
$(this).hide();
});
});
</script>
<!-- end scripts -->
</body>
</html>