• 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

Null data member crashing TagUtils

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a number of classes as follows:

Report
IOS
Scientist

Report has ----> private Vector<IOS> principals = new Vector<IOS>(); as a member variable
IOS has -------> private Scientist scientist; as a member variable
Scientist ------> private ActionErrors warningMessages = new ActionErrors();

My app is reading in some data from a file and loading it into a database. I am using Struts. The scientist datamember is NULL. When my object passes through TagUtils, I am getting the following error when principals[0].scientist.warningMessages runs through TagUtils:

SEVERE: Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspException: Invalid argument looking up property principals[0].scientist.warningMessages of bean report
at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:959)
at org.apache.struts.taglib.bean.DefineTag.doEndTag(DefineTag.java:230)

Is there any way to define scientist or instantiate so that the error does not occur? I don't want to modify the Struts code one bit.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic