Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Fidel Edwards
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ??
 
Shailesh Narkhede
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you paste whole jsp?

where your html:text tag is(child tag of which tag) ?
 
Fidel Edwards
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ??>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic