JSP页面里的JAVA代码是:
String returnPage = null;
if (session.getAttribute("returnPage") != null)
{
returnPage = String.valueOf(session.getAttribute("returnPage"));
session.removeAttribute("returnPage");
}
为什么这里returnPage是null
function go_back()
{
window.<%=returnTarget%>.location.href = "<%=returnPage%>";
}
可是这里却执行了
function init()
{
<% if ( returnPage != null )
{ %>
document.getElementById('return').focus();
<% }%>
}
String returnPage = null;
if (session.getAttribute("returnPage") != null)
{
returnPage = String.valueOf(session.getAttribute("returnPage"));
session.removeAttribute("returnPage");
}
为什么这里returnPage是null
function go_back()
{
window.<%=returnTarget%>.location.href = "<%=returnPage%>";
}
可是这里却执行了
function init()
{
<% if ( returnPage != null )
{ %>
document.getElementById('return').focus();
<% }%>
}
解决方案 »
- jbuilder2007 导出的jar can not find main class
- java按钮
- 请问一个工程有多个package怎么用-jar打包?
- 我这Socket程序怎么老是有异常,救命
- 大家看看几个题目
- 怎样让程序知道自己所执行的程序名或类名?
- 如何编译相互引用的java文件??
- 一个菜鸟级的问题(希望各位大侠给予帮助)
- 送分的新手
- 各位老大:如何设置swing组件的tooltip显示的时间,或者说当我的鼠标停在swing上面时tooltip不消失
- 怎么给Vector里面的元素排序 有现成的方法吗
- 如何判断jis第一水准 第二水准 外字??shift-jis有第一水准 第二水准 外字区分吗??
function init()
{
<% if ( returnPage != null )
{ %>
document.getElementById('return').focus();
<% }%>
}
==============================================================
那就证明他不是null,
还有楼上的大哥,即便是字符串!=null也没什么问题,没必要这也用.equals,通常于判断是不是""才用.equals吧,你这样些,岂不成了单纯和"null"字符串比较了?
只是go_back()函数是再一个点击按钮里执行的我就觉得奇怪,init里表明该变量不是null
可是go_back里,为什么取出来是null