• Post Reply Bookmark Topic Watch Topic
  • New Topic

Nested nest Tag  RSS feed

Gillian Daniel
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope that I can articulate myself well enough for someone to understand what I am saying.
I have a massive application which I am in the middle of helping to code.
I have an object - SccDTO. There are 3 other objects which extend SccDTO, LocDTO, HscDTO and HsctDTO.
I have a jsp, which uses the following code:
<nested:form action="/scc/edit">
<nested:nest property="sccDTO">
.. a little further down..
<nested:write property="requestedBy"/>
<nested:write property="installation"/>
Now, the requestedBy field is part of the SccDTO, but the installation field is part of the LocDTO, not the HscDTO or HsctDTO. (I have no logic tags in this yet, as I want to see if it will work for LocDTO.)
If I set the SccDTO in the ValidatorForm (SccBean I have called it) to be an LocDTO, then struts recognises this when the form is loaded up and outputs the installation, even though the method in the SccBean is:
* Returns the SccDTO for this Scc, which contains
* all the information to create an Scc
* @return SccDTO The SccDTO for this Scc
public SccDTO getSccDTO() {
return sccDTO;
But when I submit the form, the installation is lost. I have put in debug, and it appears (quite rightly! - I am trying to do something I wish I could avoid!) that on submit, Struts creates an object of type SccDTO.
I am wondering, is there any way I can make it create an LocDTO without changing my <nested:nest property="sccDTO"> ??
I am using struts 1.1 and Java SE and EE 1.4
Any help would be greatly appreciated, as I think I could well be bald by the end of today!!
Thank-you ever so much,
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!