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

出现的怪问题,帮忙……
以下是我的一个bean:
package   com.web.structure;

public   class   Sig_StaticVar   {
public   static   int   num=0;
public     static   String   passvalue=null
public   static   Sig_SealInfo[]   sealinfo=new   Sig_SealInfo[10];
public   static   int   getNum()
{    
return   num;
}

public   static   void   setNum()
{       ++num;
}


public   static   String   getPassvalue()
{    
return   passvalue;
}
public   static   void   setPassvalue(String   p)
{     passvalue=p;
}


public   static   void   setSeal_info(Sig_SealInfo   Sealinfo,int   index)
{
sealinfo[index]=Sealinfo;
}
public     static   Sig_SealInfo   getSeal_info(int   index)
{
return   sealinfo[index];
}

}

我在第一个页面,这样写了:

<jsp:useBean   id= "staticvar "   scope= "session "   class= "com.web.structure.Sig_StaticVar "   >
</jsp:useBean>

第二个页面中,就有这样的语句:
String   pass=request.getParameter( "pass ");//pass是由一个变量传递的;
      if(pass== "1 ")
    {Sig_StaticVar.setPassvalue(pass);}

但是页面执行第二个页面时就是出现这样的问题:
org.apache.catalina.core.StandardWrapperValve   invoke
严重:   Servlet.service()   for   servlet   jsp   threw   exception
java.lang.NullPointerException
at   org.apache.jsp.sendsealescacn.find_jsp._jspService(find_jsp.java:81)
at   org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at   org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
at   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at   org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at   org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at   org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at   org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at   java.lang.Thread.run(Th