纯粹的JSP上传 - Java / Web 开发
各位高手我想问一下,纯粹的JSP上传都运用哪些类啊
如果有源代码的话,我想借鉴以下啊!O(∩_∩)O谢谢
怎么没人回答啊!我顶
还没人啊,我再顶
在工程中加入jspsmartupload.jar,你到百度上搜索jspsmart上传文件会有相应的列子,刚好适合jsp中的上传文件,这是我写的简单的页面,详情你可以到百度上搜,希望你能学到新东西。
在jsp页面中:
<tr>
<td bgcolor="#E8E8E8"><strong>选择上传文件:<input type="file" name="publishTitle" /><input type="hidden" name="zipName"></strong></td></tr>
<jsp:directive.page import="java.text.SimpleDateFormat"/>
<%
SmartUpload mySmartUpload=new SmartUpload();
mySmartUpload.initialize(pageContext);
mySmartUpload.setMaxFileSize(5 * 1024 * 1024);//设置最大上传大小
mySmartUpload.setAllowedFilesList("zip");//设置允许上传格式
mySmartUpload.upload();//上传文件
%>
直接设置from的属性为 multipart/form-data 就可以实现上传么 ?
http://wenku.baidu.com/view/668e0d40be1e650e52ea9989.html
这是关于jspsmartupload详细解释文档,上去看看,就明白了。
用了commons-fileupload-1.2.jar和commons-io-1.3.2.jar这两个包。
save.jsp
<%@ page language="java" contentType="text/html;charset=utf-8"%>
<%@ page import="java.util.*"%>
<
相关问答:
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 52 in the jsp file: /vip_info.jsp
ÕË cannot be resolved
49: <table border="1& ......
我写了个jsp页面,然后改动了一下,改动的内容就是在jsp页面的js函数里加了个alert()语句,但是我访问这个页面时,死活都是原来页面的内容,我加了很多alert函数还是没改动前的页面内容;tomcat重启了,也重新部署这 ......
现在不想用<a> </a> 标签 ,因为点击后会出现页面重定位,给文字加上css样式就可以看起来 是href怎么实现这样的css
text-decoration:underline; cursor:hand;
引用
text-decoration:underline; cur ......