Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

IllegalArgumentException on using nested:text tag

 
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am using the nested:text tag in my JSP and when the page first loads the nested property I specify in my tag displays the right value. However on submit, I get the following exception stack trace:


Here's the code from my JSP:




My ActionForm has the property -Address(user defined object) and the getter for the address property is:


The address object contains the Street object which in turn contains the line1, line2, line3 and line4 properties of the type String.

Any ideas on where I am going wrong?

Thanks,

Kailash
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there a reason why you're using <nested:text> instead of <html:text> ? The <nested:xxx> tags sometimes manipulate the property name in ways you don't want.

I'd suggest using <html:text>.
 
Zip Ped
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your suggestion Merill. I solved the problem. It seems that the BeanUtils class was copying the properties of the current ActionForm to the properties of the ActionForm for the action class to which I was forwarding to on submit of the page. The NullPointerException was occurring in the 2nd ActionForm. I just removed the fields which were matching in both the forms to avoid the whole problem.

Yes, I do need to use the nested:text tag.

A very interesting and peculiar behaviour.
 
Why is the word "abbreviation" so long? And this ad is so short?
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic