Hi all,
i started a new enterprise application with many
servlet which simulate a web site for student for the exam prenotation and so one.
Sometimes on running the project it works all good, sometimes, as in this case, after the correct login, the server show me this message:
exception
java.lang.NullPointerException
web.Login.processRequest(Login.java:87)
web.Login.doGet(Login.java:108)
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
and here is the problem (in bold the problem, the 87 line..)...
for (Iterator itProf = profili.iterator(); itProf.hasNext()
{
Profili elem = (Profili) itProf.next();
for (Iterator itCorso = corsi.iterator(); itCorso.hasNext()
{
Corsi crs = (Corsi) itCorso.next();
if(elem.getIdcorso().equals(crs.getIdcorsi())){
out.println("<h2>"+crs.getIdcorsi( +"\t"+crs.getNomecorso()+"</h2><a href=/EsameAS2-war/Destroy?idProf="+elem.getIdprof()+">rimuovi</a>");
}
}
}
I mean there's a problem for the nullpointer exception, does someone know how could i resolve this little problem?