<input class="shopcar0tableinput" type="text" maxlength="8" value="1" name="amount2" id="amount"
onChange="showcarchange('<%=session.getAttribute("numvalue")%>')"/>
<%
out.print(request.getParameter("amount2"));
%>这里获取的值为空的,为什么??
onChange="showcarchange('<%=session.getAttribute("numvalue")%>')"/>
<%
out.print(request.getParameter("amount2"));
%>这里获取的值为空的,为什么??
解决方案 »
- 求助spring security的问题
- WebSphere中如何配置struts?
- Struts&Spring&Hibernate开发的项目会占用多少内存?
- struts requestprocessor怎样使用的??
- 数据库异常:update command denied to user .....
- 如何理解指令元素中的include 指令呢?
- 请教了快100个网友了都不会,怎么办
- 关于数据库连接,
- spring framework中自带例子jpetstore中,如何配置发送邮件确认订单(原默认状态是关闭此项功能的需要在applicationContext.xml在打开)?
- idea启动时报出这个异常
- 文件读取代码看不懂
- 哪位大神帮看看这样写有问题吗
request.getParameter是要你页面提交新的请求,在后一个页面(被请求的页面)中获取的。比如b.jsp
<form action="b.jsp">
<input type="text" name="amount2" .... />
<input type="submit" />
</form>
然后在b.jsp上面,request.getParameter("amount2"),
或者你直接访问b.jsp?amount2=abcd如果你想在b.jsp上面显示,那个是在浏览器端执行的javascript再或者,你要的其实就是
<input class="shopcar0tableinput" type="text" maxlength="8" value="1" name="amount2" id="amount"
onChange="showcarchange('<%=session.getAttribute("numvalue")%>')"/>
<%=session.getAttribute("numvalue")%>
request.getParameter("amount2")。你的请求request还没有属性呢!