• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Servlet Excepition

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 />
 
Popeye has his spinach. I have this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic