<script language = javascript>
  function csort()
  {
window.location.href="user_info.jsp?select=<%=select%>"
  return; 
  }
</script> 此时select已经用select = null来赋值了。
在user_info.jsp中:
select = (String)request.getParameter("select");
if(select!=null)
{
  out.println("ok");
}
但是没有执行。为什么?

解决方案 »

  1.   

    不用麻烦大侠,因为它把null当成字符串处理了
      

  2.   

    哈哈……
    你要得到一个空,可以这样
    ="user_info.jsp?select="
      

  3.   

    不会把,肯定会执行的阿!
    因为select不会等与null的啊!呵呵
      

  4.   

    String的
    null和空值是不同的。
    null是指没有值
    空值只是值为空,就是"";
      

  5.   

    同意ycats(加菲猫) 的说法:
    String的
    null和空值是不同的。
    null是指没有值
    空值只是值为空,就是""; 
      

  6.   

    if 空 
    window.location.href="user_info.jsp"