日期:2014-05-18  浏览次数:20749 次

request传值的问题 又是得不到想要的值
工作平台:myeclipse5.1+tomcat5.5


原来用jspsmartupload把图片和信息一起传的
后来把图片上传与信息传递分开,信息传递部分依然传不了值,
我已经把enctype= "multipart/form-data删了


------解决方案--------------------
是不是一个页面添加商品,然后嵌入一个jspsmartupload,上传个图片获得图片地址?
给你段代码看吧,用iframe嵌入,然后用JS获取上传地址

产品添加页面:
<form name= "form1 " action= "Product " method= "post ">
<input name= "type " type= "hidden " value= "addproduct " />
<table class= "tableBorder " align= "center " border= "0 " cellpadding= "2 " cellspacing= "1 " width= "96% ">
<tbody>
<tr>
<th height= "25 " colspan= "2 "> 产品发布 </th>
</tr>
<tr>
<td width= "23% " height= "23 " align= "right " class= "TableRow2 "> 产品名称: </td>
<td width= "77% " class= "TableRow2 "> <input name= "title " type= "text " size= "60 "> </td>
</tr>
<tr>
<td width= "23% " height= "23 " align= "right " class= "TableRow2 "> 产品添加日期: </td>
<td width= "77% " class= "TableRow2 "> <input name= "date " type= "text " size= "60 " value= " <%=new java.sql.Date(new java.util.Date().getTime())%> "> </td>
</tr>
<tr>
<td width= "23% " height= "23 " align= "right " class= "TableRow2 "> 产品添加人员: </td>
<td width= "77% " class= "TableRow2 "> <input name= "author " type= "text " size= "60 " value= "admin "> </td>
</tr>
<tr>
<td width= "23% " height= "23 " align= "right " class= "TableRow2 "> 产品缩略图片: </td>
<td width= "77% " class= "TableRow2 "> <input name= "pic " type= "hidden " id= "pic " size= "30 " />
<iframe src= "upload.jsp " name= "UpLoad_Ad " width= "100% " height= "22 " scrolling= "no " frameborder= "0 " id= "UpLoad_Ad "> </iframe> </td>
</tr>
<tr>
<td width= "23% " colspan= "2 " height= "23 " align= "center " class= "TableRow2 "> 产品简介: </td>
</tr>
<tr>
<td height= "23 " colspan= "2 " class= "TableRow2 ">
<FCK:editor id= "content " basePath= "../FCKeditor/ " height= "440 "> </FCK:editor> </td>
</tr>
<tr>
<td height= "23 " colspan= "2 " align= "center " class= "TableRow2 ">
<input type= "submit " name= "Submit " value= "提交 "> &nbsp;&nbsp;&nbsp;&nbsp; <input type= "reset " name= "Submit " value= "重置 "> </td>
</tr>
</tbody>
</table>
</form>

upload.jsp

<div align= "left ">
<FORM METHOD= "POST " ACTION= "upfile.jsp " ENCTYPE= "multipar