首页 新闻 赞助 找找看

jsp上传的文件显示内容为null?但是有长度

0
悬赏园豆:10 [待解决问题]

请求页面

<body>
<p>Choose the file for uploading:
<form action="accept.jsp" method=post enctype="multipart/form-data">
<input type="file" name="fileforload">
<br>
<input type=submit value=commit name=submit>
</form>
</body>

处理页面

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<base href="<%=basePath%>">

<title>My JSP 'show.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->

</head>

<body>
<%
out.print(request.getParameter("file"));
BufferedReader in=request.getReader();
String buf=null;
out.print("1:"+in.readLine());
while((buf=in.readLine())!=null)
{
out.print(buf+"<br/>");
}
%>
</body>
</html>

 

 

网上各种帖子说什么拦截器,http啥的都试过了就是显示不了内容,这是为啥?我这个也没有报错,但是内容就是空的

邗影的主页 邗影 | 初学一级 | 园豆:73
提问于:2016-11-27 19:26
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册