当前页面: 开发资料首页 → J2EE 专题 → 在这个程序中为什么str1的值总是null
在这个程序中为什么str1的值总是null
摘要: 在这个程序中为什么str1的值总是null
在这个程序中为什么str1的值总是null,str1的值不是已经从参数d传进来了吗
<%@page language="java" contentType="text/html; charset=gb2312"%>
<% for(int i=1;i<=9;i++)
{
%>
"><%=i%>
<% }
%>
<% String str=request.getParameter("n");
if(str==null)
{
return;
}
int h=Integer.parseInt(str);
%>
<%=h%>的2倍是:"><%=2*h%>
<% String str1=request.getParameter("d");
out.print(str1);
if(str1==null)
{
return;
}
int m=Integer.parseInt("str1");
%>
<%=m%>的3倍是:<%=(m*3)%>
那就是没传进来呗
String str1=request.getParameter("d");
应该就是没传过来
没取到当然是Null,检查一下为什么没传过来?
就是这个问题
...应该看看传参数到这个页面的程序是真的。给我们看这个页面的代码,没什么帮助。
你这个页面就叫Exe17.jsp是吧?
<%=h%>的2倍是:"><%=2*h%>
你得点击这个超链接后重新提交到Exe17.jsp才会把b传过来
应该是没传进来.