Struts1.x系列教程(9):上传任意多个文件

本文为原创,如需转载,请注明作者和出处,谢谢!

上一篇: Struts1.x系列教程(8):上传单个文件

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="ProgId" content="Word.Document"> <meta name="Generator" content="Microsoft Word 11"> <meta name="Originator" content="Microsoft Word 11"> <link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"> <!--[if gte mso 9]><xml> Normal 0 7.8 磅 0 2 false false false MicrosoftInternetExplorer4 </xml><![endif]--><!--[if gte mso 9]><![endif]--><style> <!-- /* Font Definitions */ &#64;font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1;} &#64;font-face {font-family:""&#64;宋体"; panose-1:2 1 6 0 3 1 1 1 1 1;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; text-align:justify; text-justify:inter-ideograph; font-size:10.5pt; font-family:"Times New Roman";} /* Page Definitions */ &#64;page {} &#64;page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt;} div.Section1 {page:Section1;} --> </style> <!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable { mso-style-parent:""; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} </style> <![endif]--> Struts2教程7:上传任意多个文件

从 《Struts1.x系列教程(8):上传单个文件》 中给出的例子可以看出,在 Struts1.x 中上传单个文件是非常简单的,但在实际应用中,上传文件的个数一般是不确定的,如在网络硬盘中,用户可以根据自己的需要上传任意多个文件(当然,网络硬盘一次上传文件的数目一般也是有上限的,如 50 个,但用户可以只上传了 3 个文件,因此,在这种情况下,上传文件的个数也是不确定的)。如果读者用过“网易网盘”或其他类似的服务程序,它们的上传文件功能基本上都是根据用户选择的文件多少来添加要上传的文件(并不是一开始就在界面上放很多 <input type=’file’> 元素来让用户输入上传文件名)。为了让读者也可以使用 Struts 来实现这个功能,在本节将给出一个用 Struts 实现的类似“网易网盘”的上传任意多个文件的 Web 程序。在实现 Web 程序之前,让我们先看看图 1 所示的主页面。


图1
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="ProgId" content="Word.Document"> <meta name="Generator" content="Microsoft Word 11"> <meta name="Originator" content="Microsoft Word 11"> <link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"> <!--[if gte mso 9]><xml> Normal 0 7.8 磅 0 2 false false false MicrosoftInternetExplorer4 </xml><![endif]--><!--[if gte mso 9]><![endif]--><style> <!-- /* Font Definitions */ &#64;font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1;} &#64;font-face {font-family:""&#64;宋体"; panose-1:2 1 6 0 3 1 1 1 1 1;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; text-align:justify; text-justify:inter-ideograph; font-size:10.5pt; font-family:"Times New Roman";} /* Page Definitions */ &#64;page {} &#64;page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt;} div.Section1 {page:Section1;} --> </style> <!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable { mso-style-parent:""; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} </style> <![endif]-->

在本程序中,用户通过在文本框中输入本地文件名或使用“浏览”按钮选择要上传的文件后,就会在界面的下方添加这个被录入的文件名,如果录入有误,或是不想上传某个文件,可以使用“删除”功能将当前文件删除。在确认正确录入所有的上传文件后,使用“上传”按钮开始上传文件。

实现这个Web程序的基本步骤和《Struts1.x系列教程(8):上传单个文件》一文中所给出的例子类似,我们可按下面五步来实现这个Web程序:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 11"><meta name="Originator" content="Microsoft Word 11"><link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"><!--[if gte mso 9]><xml> Normal 0 7.8 磅 0 2 false false false MicrosoftInternetExplorer4 </xml><![endif]--><!--[if gte mso 9]><![endif]--><style> <!-- /* Font Definitions */ &#64;font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1;} &#64;font-face {font-family:""&#64;宋体"; panose-1:2 1 6 0 3 1 1 1 1 1;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; text-align:justify; text-justify:inter-ideograph; font-size:10.5pt; font-family:"Times New Roman";} /* Page Definitions */ &#64;page {} &#64;page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt;} div.Section1 {page:Section1;} --> </style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable { mso-style-parent:""; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} </style> <![endif]-->

【第1步】建立上传文件的JSP页面
要想实现上述的功能,需要在JavaScript中使用DOM技术(关于JavaScript和DOM技术的相关内容已经超出本文讨论的范围,如果读者想了解JavaScript和DOM技术的细节部分,请参阅其他相关技术资料)。
在<samples工程目录>目录中建立一个uploadMoreFile.jsp文件,代码如下:

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> <% @pagepageEncoding = " GBK " %>
<% @tagliburi = " http://struts.apache.org/tags-html " prefix = " html " %>
< html >
< head >
< title > 上传任意多个文件(总大小不能超过2M) </ title >
< script language ="javascript" >
// 在DOM中插入一个上传文件列表项(div元素)和一个<inputtype="file"/>元素
function insertNextFile(obj)
{
// 获取上传控制个数
var childnum = document.getElementById( " files " ).getElementsByTagName( " input " ).length;
var id = childnum - 1 ;
var fullName = obj.value;
// 插入<div>元素及其子元素
var fileHtml = '';
fileHtml
+= ' < divid = " file_preview'+id+' " style = " border-bottom:1pxsolid#CCC; " > ';
fileHtml
+= ' < imgwidth = 30 height = 30 src = " images/file.gif " title = " '+fullName+' " /> ';
fileHtml
+= ' < ahref = " javascript:; " onclick = " removeFile('+id+'); " > 删除 </ a > & nbsp; & nbsp;';
fileHtml
+= fullName.substr(fullName.lastIndexOf('\\') + 1 ) + ' </ div > ';

var fileElement = document.getElementById( " files_preview " );
fileElement.innerHTML
= fileElement.innerHTML + fileHtml;
obj.style.display
= 'none'; // 隐藏当前的<inputtype=”file”/>元素
addUploadFile(childnum); // 插入新的<inputtype=”file”/>元素
}
// 插入新的<inputtype=”file”/>元素,适合于不同的浏览器(包括IE、FireFox等)
function addUploadFile(index)
{
try // 用于IE浏览器
{
var uploadHTML = document.createElement( " <inputtype='file'id='file_ " + index +
"
'name='file[ " + index + " ]'onchange='insertNextFile(this)'/> " );
document.getElementById(
" files " ).appendChild(uploadHTML);
}
catch (e) // 用于其他浏览器
{
var uploadObj = document.createElement( " input " );
uploadObj.setAttribute(
" name " , " file[ " + index + " ] " );
uploadObj.setAttribute(
" onchange " , " insertNextFile(this) " );
uploadObj.setAttribute(
" type " , " file " );
uploadObj.setAttribute(
" id " , " file_ " + index);
document.getElementById(
" files " ).appendChild(uploadObj);
}
}
function removeFile(index) // 删除当前文件的<div>和<inputtype=”file”/>元素
{
document.getElementById(
" files_preview " ).removeChild(document.getElementById( " file_preview " + index));
document.getElementById(
" files " ).removeChild(document.getElementById( " file_ " + index));
}
function showStatus(obj) // 显示“正在上传文件”提示信息
{
document.getElementById(
" status " ).style.visibility = " visible " ;
}
</ script >
</ head >
< body >
< html:form enctype ="multipart/form-data" action ="uploadMoreFile" >
< span id ="files" > <% -- 在此处插入用于上传文件的input元素 -- %>
< input type ="file" id ="file_0" name ="file[0]" onchange ="insertNextFile(this)" />
</ span > &nbsp;&nbsp;
< html:submit value ="上传" onclick ="showStatus(this);" />
</ html:form > < p >
< div id ="status" style ="visibility:hidden;color:Red" > 正在上传文件 </ div > < p >
<% -- 在此处用DOM技术插入上传文件列表项 -- %>
< div id ="files_preview" style ="width:500px;height:500px;overflow:auto" ></ div >
</ body >
</ html >

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 11"><meta name="Originator" content="Microsoft Word 11"><link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"><!--[if gte mso 9]><xml> Normal 0 7.8 磅 0 2 false false false MicrosoftInternetExplorer4 </xml><![endif]--><!--[if gte mso 9]><![endif]--><style> <!-- /* Font Definitions */ &#64;font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1;} &#64;font-face {font-family:""&#64;宋体"; panose-1:2 1 6 0 3 1 1 1 1 1;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; text-align:justify; text-justify:inter-ideograph; font-size:10.5pt; font-family:"Times New Roman";} /* Page Definitions */ &#64;page {} &#64;page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt;} div.Section1 {page:Section1;} --> </style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable { mso-style-parent:""; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} </style> <![endif]-->

在uploadMoreFile.jsp文件中使用了JavaScript和DOM技术来控制新加入的上传文件以及删除不需要的上传文件。并且在加入<input type=”file”/>元素时考虑了不同的浏览器的差异(详见addUploadFile)。

【第2步】建立ActionForm的子类

在<samples工程目录>\src\actionform目录中建立一个UploadMoreForm.java文件,代码如下:

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> package actionform;
import org.apache.struts.action. * ;
import org.apache.struts.upload.FormFile;
import java.util. * ;
public class UploadMoreForm extends ActionForm
{
private List < FormFile > myFiles = new ArrayList < FormFile > (); // 用于保存不定数量的FormFile对象

public FormFilegetFile( int i) // 索引属性
{
return myFiles.get(i);
}
public void setFile( int i,FormFilemyFile) // 索引属性
{
if (myFile.getFileSize() > 0 ) // 只有上传文件的字节数大于0,才上传这个文件
{
myFiles.add(myFile);
}
}
public int getFileCount() // 获得上传文件的个数
{
return myFiles.size();
}
}

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 11"><meta name="Originator" content="Microsoft Word 11"><link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"><!--[if gte mso 9]><xml> Normal 0 7.8 磅 0 2 false false false MicrosoftInternetExplorer4 </xml><![endif]--><!--[if gte mso 9]><![endif]--><style> <!-- /* Font Definitions */ &#64;font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1;} &#64;font-face {font-family:""&#64;宋体"; panose-1:2 1 6 0 3 1 1 1 1 1;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; text-align:justify; text-justify:inter-ideograph; font-size:10.5pt; font-family:"Times New Roman";} /* Page Definitions */ &#64;page {} &#64;page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt;} div.Section1 {page:Section1;} --> </style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable { mso-style-parent:""; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} </style> <![endif]-->在UploadMoreFile类中使用了List对象来保存不定数量的FormFile对象。读者也可以使用其他的集合类来保存这些FormFile对象。而且在UploadMoreFile类中使用了带索引的属性,详见getFile和setFile方法。在这两个方法中,第一个参数是一个int类型的变量。要注意的是,索引属性的get和set方法的第一个参数必须是int类型的变量,否则系统会不认这个索引属性。这个索引属性用于和客户端不定数量的<input type=”file” />元素相对应,每一个索引项代表一个<input type=”file” />元素上传的文件(FormFile对象)。

【第3步】建立Struts动作类(Action的子类)
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 11"><meta name="Originator" content="Microsoft Word 11"><link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"><!--[if gte mso 9]><xml> Normal 0 7.8 磅 0 2 false false false MicrosoftInternetExplorer4 </xml><![endif]--><!--[if gte mso 9]><![endif]--><style> <!-- /* Font Definitions */ &#64;font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1;} &#64;font-face {font-family:""&#64;宋体"; panose-1:2 1 6 0 3 1 1 1 1 1;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; text-align:justify; text-justify:inter-ideograph; font-size:10.5pt; font-family:"Times New Roman";} /* Page Definitions */ &#64;page {} &#64;page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt;} div.Section1 {page:Section1;} --> </style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable { mso-style-parent:""; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} </style> <![endif]-->

由于在《Struts1.x系列教程(8):上传单个文件》一文的例子中的UploadAction类中已经有了一个saveFile方法用于保存单个上传文件,因此,处理多个上传文件的Struts动作类可以从UploadAction类继承。在<samples工程目录>\src\action目录中建立一个UploadMoreAction.java文件,代码如下:

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> package action;

import javax.servlet.http. * ;
import org.apache.struts.action. * ;
import org.apache.struts.upload.FormFile;
import java.io. * ;
import actionform. * ;

public class UploadMoreAction extends UploadAction
{
public ActionForwardexecute(ActionMappingmapping,ActionFormform,
HttpServletRequestrequest,HttpServletResponseresponse)
{
UploadMoreFormumForm
= (UploadMoreForm)form;
PrintWriterout
= null ;
int count = 0 ;
try
{
response.setCharacterEncoding(
" GBK " );
out
= response.getWriter();
count
= umForm.getFileCount(); // 获得上传文件的总数
for ( int i = 0 ;i < count;i ++ )
{
saveFile(umForm.getFile(i));
// 开始保存每一个上传文件
}
out.println(
" 成功上传 " + String.valueOf(count) + " 个文件. " );
}
catch (Exceptione)
{
out.println(e.getMessage());
}
return null ;
}
}

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 11"><meta name="Originator" content="Microsoft Word 11"><!--[if gte mso 9]><xml> Normal 0 7.8 磅 0 2 false false false MicrosoftInternetExplorer4 </xml><![endif]--><!--[if gte mso 9]><![endif]--><style> <!-- /* Font Definitions */ &#64;font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1;} &#64;font-face {font-family:""&#64;宋体"; panose-1:2 1 6 0 3 1 1 1 1 1;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; text-align:justify; text-justify:inter-ideograph; font-size:10.5pt; font-family:"Times New Roman";} /* Page Definitions */ &#64;page {} &#64;page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt;} div.Section1 {page:Section1;} --> </style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable { mso-style-parent:""; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} </style> <![endif]-->【第4步】配置struts-config.xml

在这一步来配置一下在第2步和第3步分别建立的ActionForm和Action的子类。打开struts-config.xml文件,在<form-beans>元素中加入如下的子元素:

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> < form-bean name ="uploadMoreForm" type ="actionform.UploadMoreForm" />

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 在<action-mappings>元素中加入如下的子元素:

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> < action name ="uploadMoreForm" path ="/uploadMoreFile" scope ="request" type ="action.UploadMoreAction" />

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 11"><meta name="Originator" content="Microsoft Word 11"><!--[if gte mso 9]><xml> Normal 0 7.8 磅 0 2 false false false MicrosoftInternetExplorer4 </xml><![endif]--><!--[if gte mso 9]><![endif]--><style> <!-- /* Font Definitions */ &#64;font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1;} &#64;font-face {font-family:""&#64;宋体"; panose-1:2 1 6 0 3 1 1 1 1 1;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; text-align:justify; text-justify:inter-ideograph; font-size:10.5pt; font-family:"Times New Roman";} /* Page Definitions */ &#64;page {} &#64;page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt;} div.Section1 {page:Section1;} --></style>【第5步】复制gif图片

本例中使用了一个gif图,在Web根目录中建立一个images目录,并复制一个file.gif文件(30*30)到这个目录(读者可以使用自己喜欢的任何gif图片)。
由于在《Struts1.x系列教程(8):上传单个文件》一文的例子中已经设置了上传文件的保存路径和上传文件的大小限制,因此,在本例中仍然使用这一设置。但要注意的是,在上传多个文件时,最大上传文件尺寸指的是所有上传文件的尺寸之和,而不是指每个文件的尺寸。

启动Tomcat后,在IE地址栏中输入如下的URL来测试程序:

http://localhost:8080/samples/uploadMoreFile.jsp

下一篇: Struts1.x系列教程(10):Validator验证框架入门

国内最棒的Google Android技术社区(eoeandroid),欢迎访问!

《银河系列原创教程》发布

《Java Web开发速学宝典》出版,欢迎定购

Struts1.x框架实现多文件上传教程 本文还有配套的精品资源,点击获取 简介:本教程讲解了如何在Java Web开发中使用Struts1.x框架上传多个文件。介绍了在HTML表单中使用 <input type="file"> 元素配置多文件上传,以及如何在Struts1.x的配置文件中声明处理文件上传的Action。接着详细说明了在Action类中使用Apache Commons Fi... 阅读详情

相关推荐

使用struts1.x上传多个文件的一中方法

在项目中要上传多个文件,经过百度,Google,终于弄出来了。

Docker构建镜像卡在下载Python?源配置与缓存优化全攻略

在容器化应用开发中,镜像构建是高频环节,而依赖下载缓慢或卡顿往往让人头疼。无论是拉取基础镜像,还是执行pip install安装Python依赖,都可能因网络源配置不当而陷入长时间等待。理解镜像构建的分层原理和依赖获取机制,是定位问题的关键。通过切换高效的镜像仓库、配置国内pip源、利用BuildKit缓存等手段,可以显著提升构建效率。这些方法不仅适用于Python应用,也广泛适用于各类依赖管理中。当构建卡在某个下载步骤时,系统化的排查思路远比反复重试更有效。本文从源配置、缓存利用到实际项目构建,提供了一套

keke1314520的博客 162

struts1上传多个文件同时

struts1上传多个文件 jquery multi什么的组件

国产AI短剧平台选型三原则:分镜可控、审核可配、分发同步

AI短剧平台已从单点生成工具演进为内容工业化核心枢纽,其本质是融合剧本生成、分镜控制、语音合成、合规审核与多端分发的全链路系统。理解‘AI短剧平台’需回归基础技术逻辑:它依赖大模型语义理解与多模态对齐能力,通过可控分镜干预、可配置审核规则和原子化状态同步,支撑可持续连载生产。这类平台的技术价值在于降低内容交付不确定性,提升ROI稳定性,广泛应用于微信小程序、抖音小店、H5落地页等泛私域分发场景。本文聚焦真实项目验证的三大硬指标,直击创作者在国产AI短剧平台选型中的关键决策盲区。

keke1314520的博客 395

Servlet实现文件上传的三种方法总结

主要介绍了Servlet实现文件上传的三种方法总结的相关资料,这里提供三种实例,帮助大家理解这部分内容,需要的朋友可以参考下

struts1.x多文件上传

struts1.x多文件上传, 感觉不错.

MVP开发实战:轨道交通技术解决方案从0到1

MVP(最小可行产品)是一种通过构建具备核心功能的最小化产品来快速验证市场假设的产品开发策略。其核心原理是在控制开发成本的前提下,聚焦解决特定场景下的关键问题。在技术实现上,MVP项目通常采用Web应用、移动应用或物联网设备等架构,支持云端部署、本地部署或混合部署模式。对于轨道交通行业的技术解决方案,MVP开发模式能够有效验证车站运营管理、列车调度优化等具体场景的业务价值。通过建立自动化测试流程和完善的技术监控体系,可以确保核心功能的稳定性,为后续产品迭代提供数据支撑。本文以'这把火车MVP'项目为例,深入

keke1314520的博客 328

Matlab之fdesign的应用说明

fdesign 是 MATLAB 中用于数字滤波器设计的工具(属于),它提供了一种系统化的方式来定义滤波器参数并生成相应的滤波器。指定滤波器的频率、幅度等参数。例如,设计一个低通滤波器:Fs = 1000;% 采样率 (Hz)% 通带截止频率% 阻带截止频率Apass = 1;% 通带衰减 (dB)Astop = 60;% 阻带衰减 (dB)

嵌入式老牛的博客 1045

【原创】Struts1.x系列教程(9):上传任意多个文件

本文为原创,如需转载,请注明作者和出处,谢谢! 从《Struts1.x系列教程(8):上传单个文件》中给出的例子可以看出,在Struts1.x中上传单个文件是非常简单的,但在实际应用中,上传文件...

cishiyuan0609的博客 122

CVPR2021 CenterPoint源码解读:从VoxelNet到两阶段优化的完整实现细节

本文深度解析了CVPR 2021 CenterPoint模型的完整实现细节,从VoxelNet体素化、稀疏卷积Backbone,到基于中心点的检测头与两阶段精修机制。文章提供了从环境搭建、数据预处理到核心代码模块(如热力图生成、关键点特征提取与MLP Refiner)的实战指南,并分享了训练策略、多任务损失调优及可视化调试等关键工程实践,助力开发者深入理解并复现这一高效的3D目标检测框架。

linux的博客 466

长短期记忆网络(Long Short-Term Memory networks, LSTM)

如何简单的理解LSTM——其实没有那么复杂:

weixin_39910711的博客 2万+

Struts2教程:上传任意多个文件

一、上传单个文件上传文件是很多web程序都具有的功能。在struts1.x中已经提供了用于上传文件的组件。而在struts2中提供了一个更为容易操作的上传 文件组件。所不同的是,struts1.x的上传组件需要一个actionform来传递文件,而struts2的上传组件是一个拦截器(这个拦截器不用 配置,是自动装载的)。在本文中先介绍一下如何用struts2上传单个文件,最后介绍一下用str

红颜无暇电脑网,最新的专业 IT 资讯-http://it.hywxfashion.cn 574

化工热力学软件:Aspen Plus二次开发_(9).过程控制与动态模拟v1

Aspen Plus 提供了丰富的过程控制工具和方法,可以用于静态和动态过程的模拟和控制策略的开发。通过控制回路设计、动态模拟、优化工具和数据交换接口,用户可以设计和优化各种复杂的控制策略,提高化工生产的稳定性和效率。此外,结合外部软件(如MATLAB、Simulink、LabVIEW等),可以实现更高级的控制策略,如自适应控制和模型预测控制,进一步提升过程控制的精度和灵活性。希望本文的内容能帮助用户更好地理解和应用Aspen Plus中的过程控制功能。

kkchenjj的博客 396

struts 上传任意多个文件

转自:http://1zebra.iteye.com/blog/427260   在struts1.x中,若使用FormFile[]数组来做批量上传并不能成功。 下面这种方法只是通过struts1.x中的MultipartRequestHandler来获取&lt;input type="file" /&gt;控件来达到批量上传的目的 1.jsp页面为 &lt;html:file propert...

Only the heart peace will be prosperity 180

Python实现多元线性回归(Multiple Linear Regression)

多元线性回归是一种用于建立多个自变量与因变量之间关系的统计学方法。在多元线性回归中,我们可以通过多个自变量来预测一个因变量的值。每个自变量对因变量的影响可以用回归系数来表示。

CSDN 精品推荐 4313

FPGA 学习笔记:Vitis IDE launch failed 的解决方法

FPGA 学习笔记:Vitis IDE launch failed 的解决方法

坚韧与专注 1万+

重温经典struts1之文件上传

struts1实现文件上传功能

dy051107的博客 1317

Kile5报错—> ARM-Compiler ‘Default Compiler Version 5‘ which is not available安装使用Compiler Version 5 的办法

Kile5报错—> ARM-Compiler ‘Default Compiler Version 5‘ which is not available安装使用Compiler Version 5 的办法

weixin_72050316的博客 1153
上一篇: 成功感言
下一篇: Weblogic10 + EJB3入门教程(1):编写第一个无状态会话Bean(Stateless Session Bean)...
keke1314520
博客等级 码龄20年 7粉丝 714原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值