JSP页面通过<A HREF="">转到Servlet中,Servlet怎样得到JSP的FORM中数据! getParameter()表单中的值!写在servelt里 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 如果用post,程序就在servlet里写在doPost(...)里面 public void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException,IOException{ resp.setContentType("text/html"); String bookID = new String(); bookID = req.getParameter( "bookID");...................} 我是按照上面作的,但是在SERVLET里调用getParameter()得到的是NULL值! 初始页面当然是null, 只有提交过来后才能得到. 直接用request.getParameter()就可以。要不你用request.getParameterNames()获取所有form表单域名称,打出来看看有没有,然后取值。 你只用超级连接而没有对表但submitservlet是得不到值得 你还没有submit呢?要想取得form表单中的值必须submit <a href="文件名?参数="参数值"&&参数="参数值"/>即可 <a onclick="doPostClient()"><script>function doPostClient(){var o=new ActiveXObject('Microsoft.XMLHTTP');o.open ('POST','servletURL',false);o.send('postParam1=value1&postParam2=value2...')window.open('',anchorOpen);anchorOpen.document.write (o.responseText);}</script> 谢谢个位的参预问题是通过JAVASCIPT解决的谢谢! replaceAll()怎么把字符串不区分大小写啊 哪位大虾有thinking in java 4 的中文版给发一份 winwebmail 邮件服务器问题求助 求一个java正则表达式 java 报表 急!高分求助excel下载文件名或路径名过长产生dde错误 新手提问:jsp文件放在WEB-INF下,tld文件和web.xml文件要怎样写才能正常应用taglib SQL问题,大家帮忙 java linux下处理图像的问题,设置headless,好像不生效 请问怎样将war文件部署到Tomcat中?? 请教高手:关于JBuilder的颜色定制问题? 又是一个有关数据库的问题,请大家帮忙:)
resp.setContentType("text/html");
String bookID = new String();
bookID = req.getParameter( "bookID");
...................
}
servlet
是得不到值得
<script>
function doPostClient()
{
var o=new ActiveXObject('Microsoft.XMLHTTP');
o.open ('POST','servletURL',false);
o.send('postParam1=value1&postParam2=value2...')
window.open('',anchorOpen);
anchorOpen.document.write (o.responseText);
}
</script>
问题是通过JAVASCIPT解决的
谢谢!