• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet Excepition

 
Qasim Shabbir
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ill try to invoke jsp but in first request it raised exception.
*
A Servlet Exception Has Occurred
org.apache.jasper.JasperException: Attempted a bean operation on a null object.
......
*
here is my JSP COde
there perameters is same as beans properties
*********
<java:useBean id="data" class="beans.CompoundInterestBean" scope ="request"/>
<java:setProperty name="data" property="*" />
</java:useBean>
<html>
<body>
<p font color=red>
If you Invest $<jsp:getProperty name="data" property="principle"/>
for <jsp:getProperty name="data" property="years"/>
at an Interest Rate of
<jsp:getProperty name="data" property="interstRate"/>%
Compounding monthly you Have
$<jsp:getProperty name="data" property="futureValue"/>
</p>
</body>
</html>
note : i m using tomcat 4.0
JSP & html Path is ..examples/JSP/
and Beans path ..exampes/WEB-INF/classes/beans
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to the message, your "data" object might be null. Verify that before trying to set any of it's properties.
 
Amir Kamran
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!
ur using wrong tags
<java:useBean attributes />
<java:setProperty attributes />
These tags are wrong use <jsp:useBean />
and <jsp:setProperty />
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!