jsp图片上传问题路径问题
这是我的第一个页面upload.jsp
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.util.*,com.jspsmart.upload.*" %>
<html>
<head>
<title>上传文件 </title>
</head>
<body>
<form id="form1" name="msform" method="post" action="do_upload.jsp" enctype="multipart/form-data" onSubmit="return Check_Found(this);">
<%String files=(String)session.getAttribute("files");%>
<table width="50%" border="1" align="center">
<tr>
<td align="center"> <input type="text" name="name"> </td>
</tr>
<tr>
<td align="center">产品说明:
<input type="file" name="file2" value=" <%=files%>"/>
<input type="submit" name="Submit" value="上传图片" /> </td>
</tr>
</table>
</form>
</body>
</html>
这是第二个页面do_upload.jsp
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.util.*,com.jspsmart.upload.*" %>
<html>
<head>
<title>文件上传处理页面 </title>
</head>
<body>
<%
SmartUpload su=new SmartUpload();
su.initialize(pageContext);
su.upload();
String name;
int count=su.save("/upload",su.SAVE_VIRTUAL);
out.println(count+"个文件上传成功! <br>");
for(int i=0;i <su.getFiles().getCount();i++)
{
com.jspsmart.upload.File file=su.getFiles().getFile(i);
if(file.isMissing()) continue;
String files=file.getFileName();
}
%>
</body>
</html>
要让他的上传的文件名出现在第一个页面中的文本框中