• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Null Object

 
Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<jsp:useBean id="person" class="foo.Person" scope="request" />
<jsp:getProperty name="name" property="name" />

I am using the standard action to get the property. But i am getting the following error...

org.apache.jasper.JasperException: Attempted a bean operation on a null object.
org.apache.jasper.runtime.JspRuntimeLibrary.handleGetProperty(JspRuntimeLibrary.java:603)
org.apache.jsp.request_jsp._jspService(request_jsp.java:80)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
HelloWorld.doGet(HelloWorld.java:18)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)




Please advice.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Amandeep Singh:
[QB]<jsp:useBean id="person" class="foo.Person" scope="request" />
<jsp:getProperty name="name" property="name" />

culprit:
<jsp:getProperty name="name" property="name" />

use:
<jsp:getProperty name="person" property="name" />

Hope This Helps
 
Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what a silly mistake i made, i will do try this at home today.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic