File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Nested nest Tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Nested nest Tag" Watch "Nested nest Tag" New topic

Nested nest Tag

Gillian Daniel

Joined: Dec 09, 2003
Posts: 9
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,
I agree. Here's the link:
subject: Nested nest Tag
It's not a secret anymore!