Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Attempted a bean operation on a null object

 
rakesh krish
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,


I need help with this.....I am just trying to set values in beans and trying to display them but i am getting this error message..


org.apache.jasper.JasperException: Attempted a bean operation on a null object.
org.apache.jasper.runtime.JspRuntimeLibrary.handleGetProperty(JspRuntimeLibrary.java:603)
org.apache.jsp.display_jsp._jspService(display_jsp.java:79)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:694)
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:665)
org.apache.jsp.secondpage_jsp._jspService(secondpage_jsp.java:98)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


The code goes like this...




Please advice me on the error i received.

Thanks in advance
rakesh


 
Campbell Ritchie
Sheriff
Pie
Posts: 49446
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch rakesh krish

The message tells you exactly what is going wrong. You need to make sure the reference does not point to null before you try to use it. The code to initialise the reference is not shown in your posting.
Please always use the code button for code; I shall try to edit your post, since you are new; if I succeed you can see how much better it looks
 
rakesh krish
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Campbell Ritchie,


Thanks for taking time in trying to help me out. I did initialise the reference but still i am getting the same error.Please do advice...The bean part of the code is as follows.




Please do advice as its the second day that i am stuck at the same place ..
 
Campbell Ritchie
Sheriff
Pie
Posts: 49446
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have already shown us that code, which does not appear to be where your problem is occurring. You need to find the line number from the stack trace.

And do you really want to record a password as a field of a bean?
 
rakesh krish
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was trying to learn how this bean concept works in jsp... I just put some random fields. ..I have got it fixed..I was not initialising my refernce bean in my display jsp.That was creating the error as you suggested..Thanks for your help Campbell Ritchie..

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic