日期:2014-05-18  浏览次数:20773 次

为何浏览器会报对象为空呢?
<%@   page   contentType= "text/html;   charset=gb2312 "   %>
<%@   page   import= "java.sql.* "   %>
<%@   page   language= "java "   %>
<%@   page   import= "java.util.Date "   %>
<%@   page   import= "common.* "   %>
<%@   page   import= "java.text.* "   %>
<jsp:useBean   id= "checkdata "   class= "common.CheckData "   scope= "page "   />
<jsp:useBean   id= "user "   class= "simis.User "   scope= "session "   />
<%if   (!user.isLogin())   {%>
          <jsp:include   page= "loginFail.jsp "   flush= "true "   />
<%}   else   {%>

<%!
String   strSQL   =null;//查询语句
String   strYear=null;       //年份
String   strBegin=null;//起始年月
String   strEnd=null;//终止年月
String   isNull   =null;//存放年份
Date   nowDate   =   new   Date();
ResultSet   rs   =   null;
DBSQL   db   =   new   DBSQL();
CodeTable   codeTable   =   null;
%>
<%
        isNull   =   request.getParameter( "Year ");
      if(isNull   !=   null)
      {
              strYear   =   isNull;
      }
      else   if(user.getYear()   !=   null)
      {
              strYear   =   user.getYear();
      }
      else
      {
              strYear   =Integer.toString(DateTool.convertDateToYear(nowDate));
      }
      strBegin   =   strYear;
      strEnd   =   Integer.toString(Integer.parseInt(strYear)+1);

String   strBegin=null;//起始年月和       else   if(user.getYear()   !=   null).
一进这个网页先报前者对象为空,查询其他年份就报后者对象为空.
如何解决呢?谢谢.


------解决方案--------------------
your javabean has a error.