把你前台上传的jsp页面给我看看
解决方案 »
- 关于简单的spring3.x的自动装载autowire
- 登录流程问题
- <img src="${base }${slist.salesmPicture}" >图片问题
- 关于EJB2.0 EJB3.0的问题
- 求救:jmail 中java.io.UnsupportedEncodingException: unicode-1-1-utf-7 解决方法
- was向mq里面发消息为什么说:javax.naming.NameNotFoundException: Name jms not found in context "java:comp/env".
- java 字符串(表达式)转换为 表达式计算 问题?急用谢谢!
- Tomcat问题
- 求教Axis,在线等!
- 关于jsp做客户端调用ejb的问题?????望各位兄弟们救救我吧!!!!!
- java 使用bufferedreader 输入二维数组 新手求助
- java中的大批量数据开销户的性能优化
<div class="container">
<div id="forms" class="mt10">
<div class="box">
<div class="box_border">
<div class="box_top"><b class="pl15">表单</b></div>
<div class="box_center">
<table class="form_table pt15 pb15" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="td_right">题目:
<s:fielderror>
<s:param>title</s:param>
</s:fielderror>
</td>
<td class=""><input type="text" name="title" id="title" class="input-text lh30" size="40">
</td>
</tr>
<tr >
<td class="td_right">总分:
<s:fielderror>
<s:param>score</s:param>
</s:fielderror>
</td>
<td class=""><input type="text" name="score" id="score" class="input-text lh5" size="5">
</td>
</tr>
<tr>
<td class="td_right">听力文件:
<s:fielderror>
<s:param>files</s:param>
</s:fielderror>
</td>
<td class="">
<s:file name="files" class="input-text lh5" ></s:file>
</td>
</tr>
<tr>
<td class="td_right">是否加入题库:</td>
<td class="">
<select id="isshare" name="isshare" class="input-text">
<option value="0"> 否 </option>
<option value="1"> 是 </option>
</select></td>
</tr>
<tr>
<td class="td_right"> </td>
<td class="">
<input type="submit" name="button" onclick="check()" class="btn btn82 btn_save2" value="下一步">
<input type="reset" name="button" class="btn btn82 btn_res" value="重置"> </td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</s:form>
update Action的方法,楼主不妨试一下我的:private File uploadFile;
private String uploadFileFileName; public String upload2() throws Exception {
FileOutputStream fos = null;
FileInputStream fis = null;
try {
fos = new FileOutputStream("D:\\" + getUploadFileFileName());
fis = new FileInputStream(getUploadFile());
byte[] buffer = new byte[1024];
int len = 0;
while ((len = fis.read(buffer)) > 0) {
fos.write(buffer, 0, len);
}
System.out.println("上传成功");
} catch (Exception e) {
System.out.println("文件上传失败");
e.printStackTrace();
} finally {
if (fis != null) {
try {
fis.close();
} catch (IOException e) {
e.printStackTrace();
}
}
if (fos != null) {
try {
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return SUCCESS;
}
public File getUploadFile() {
return uploadFile;
} public void setUploadFile(File uploadFile) {
this.uploadFile = uploadFile;
} public String getUploadFileFileName() {
return uploadFileFileName;
} public void setUploadFileFileName(String uploadFileFileName) {
this.uploadFileFileName = uploadFileFileName;
}
还有就是 你上传一个TXT试试 排除程序的问题