下面是相应的代码,不知道有没有人遇到过,麻烦告知一下解决办法:提交页面:<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>upload</title>
<script language="javascript" type="text/javascript" src="jquery-1.4.4.min.js"></script>
<script language="javascript" type="text/javascript" src="jquery.form.js"></script>
<script type="text/javascript">
$(document).ready(function(){var options = {
url:'/uploadFile/upload.action',
type:'POST',
dataType:'script',
success: function(){alert("ok!");}
};
$('#form1').ajaxForm(options);$("#upload").click(function(){
$('#form1').submit();
});$("#tijiao").click(function(){
document.form1.action = "receive.jsp";
document.form1.submit();
});
});
</script>
</head>
<body>
<form action="receive.jsp" name="form1" id="form1" method=post>
<table width="500" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="100">名 字:</td>
<td colspan="2"><input type="text" name="name" id="name" value="" /></td>
</tr>
<tr>
<td width="100">本地选择:</td>
<td width="280"><input type="file" name="selPicture" style="width: 250px; height: 23px; font-size: 16px"></td>
<td width="120"><input type="button" name="upload" id="upload" value="上传" style="width: 70px; height: 25px"></td>
</tr>
<tr><td colspan="3"><input type="button" value="提交" name="tijiao" id="tijiao"/></td></tr>
</table>
</form>
</body>
</html>接收页面:<%@ page language="java" import="java.util.*,com.jspsmart.upload.*,java.io.*" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>receive file</title>
</head>
<body>
<%
request.setCharacterEncoding("utf-8");
String name = request.getParameter("name");
%>
姓名:<%=name %></body>
</html>上传采用的是smartupload插件,文件上传没有问题,但是得到的姓名为null
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>upload</title>
<script language="javascript" type="text/javascript" src="jquery-1.4.4.min.js"></script>
<script language="javascript" type="text/javascript" src="jquery.form.js"></script>
<script type="text/javascript">
$(document).ready(function(){var options = {
url:'/uploadFile/upload.action',
type:'POST',
dataType:'script',
success: function(){alert("ok!");}
};
$('#form1').ajaxForm(options);$("#upload").click(function(){
$('#form1').submit();
});$("#tijiao").click(function(){
document.form1.action = "receive.jsp";
document.form1.submit();
});
});
</script>
</head>
<body>
<form action="receive.jsp" name="form1" id="form1" method=post>
<table width="500" cellpadding="0" cellspacing="0" border="0">
<tr>
<td width="100">名 字:</td>
<td colspan="2"><input type="text" name="name" id="name" value="" /></td>
</tr>
<tr>
<td width="100">本地选择:</td>
<td width="280"><input type="file" name="selPicture" style="width: 250px; height: 23px; font-size: 16px"></td>
<td width="120"><input type="button" name="upload" id="upload" value="上传" style="width: 70px; height: 25px"></td>
</tr>
<tr><td colspan="3"><input type="button" value="提交" name="tijiao" id="tijiao"/></td></tr>
</table>
</form>
</body>
</html>接收页面:<%@ page language="java" import="java.util.*,com.jspsmart.upload.*,java.io.*" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>receive file</title>
</head>
<body>
<%
request.setCharacterEncoding("utf-8");
String name = request.getParameter("name");
%>
姓名:<%=name %></body>
</html>上传采用的是smartupload插件,文件上传没有问题,但是得到的姓名为null
解决方案 »
- java文字编辑插件
- 左边树形菜单的生成,不是使用tree控件
- Exception starting filter struts2 帮下忙 谢谢
- jfreechart 问题,急急急急急急急急急急急~
- 关于tomcat 5.0.28的问题,一直没有解决!大家帮忙 60 分
- 近视眼患者的福音,能够根治近视眼,请进入
- JSP在不同浏览器上的时间显示问题
- 画数据图形的javabean在jsp页面中怎么调用呢?要给bean传输数据还要显示出来
- 请问Tomcat怎么在开机的时候让它自动启动
- JBuilder里如何配置JSP服务器?
- 求助:java.security.NoSuchProviderException: Provider 'BC' not found
- 关于List<Map>的JSON数据问题
String Name = su.getRequest().getParameter("Name");
.....
自己研究吧~!