wood burning stoves 2.0*
The moose likes Struts and the fly likes significance of id and property in <bean:define  /> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "significance of id and property in <bean:define  />" Watch "significance of id and property in <bean:define  />" New topic
Author

significance of id and property in <bean:define />

Fidel Edwards
Ranch Hand

Joined: Mar 19, 2008
Posts: 231
Hello Members ,

Can anybody tell me the significance of


To access this we use
This time code is not running and giving the exception


In my form bean there is


So whenever i tried the

i.e. the property's name has the same name as given in id in <bean:define > it works fine .I don't know why is it happening ??


God Gave Me Nothing I Wanted, He Gave Me Everything I Needed.
OCPJP6
Shailesh Narkhede
Ranch Hand

Joined: Jul 10, 2008
Posts: 368
Can you paste whole jsp?

where your html:text tag is(child tag of which tag) ?


Thanks,
Shailesh
Fidel Edwards
Ranch Hand

Joined: Mar 19, 2008
Posts: 231
Shailesh Narkhede wrote:Can you paste whole jsp?

where your html:text tag is(child tag of which tag) ?





It is my correctly running code in which first smiley must be same as second smiley ??

Really Confusing !!
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Does the ActionForm have a publicly-accessible getter for the DTO? You show only a private member, although your message vaguely implies that there is: it's really important to be clear in your messages what you've actually implemented.
Fidel Edwards
Ranch Hand

Joined: Mar 19, 2008
Posts: 231
David Newton wrote:Does the ActionForm have a publicly-accessible getter for the DTO? You show only a private member, although your message vaguely implies that there is: it's really important to be clear in your messages what you've actually implemented.


VehicleRegistrationForm.jsp
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What specifically is the problem? That it only works when the text tag uses "vehicleDTO.file"?

If so, I'd imagine that the text tag isn't using the defined bean but instead it's accessing the form directly. I don't know if you can use a <bean:define> bean in a text tag--the form tags access the form directly, if I remember correctly.
Fidel Edwards
Ranch Hand

Joined: Mar 19, 2008
Posts: 231
David Newton wrote:What specifically is the problem? That it only works when the text tag uses "vehicleDTO.file"?

If so, I'd imagine that the text tag isn't using the defined bean but instead it's accessing the form directly. I don't know if you can use a &lt;bean:define&gt; bean in a text tag--the form tags access the form directly, if I remember correctly.


Yeah !! You are right !
But my problem is that when i am landing to this JSP page it is just showing those form attributes which are present in FormBean rather than normal Bean Class (or DTO).While I created a setter/getter of DTO in Form Bean.

But still ,to access DTO values I need to define bean explicitly.And in this case I have to define


Well FYI ! If i retrieve all the values from DTO then we do not need to define bean explicitly.

Here My question is that Whether is It necessary to keep the same name of id and property in <bean define while we are using the properties of DTO and FormBean at the same JSP ??>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: significance of id and property in <bean:define />
 
Similar Threads
How To Create This Drop-Down List
assign value of bean:write in variable
help :how to get value from logic:iterate
bean:define , null checks and logic:present
beans and javascript