• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

struts2 textfield tag not populating with correct value from action class

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

My jsp page uses struts2 text field tags to allow people to insert the different image url's into a form that they can submit, which then adds the urls to the database for that image.
If there is already a value in the database for this particular Image, then an image object populates the different url string properties of my action class, that the textfields then get populated from.
The action class has string properties for top, bottom, sidea, sideb, front, and back.

This works fine, all the textfields get their values from the action class and are populated. The user can see what info is in the database for this particular image,
and change it if they want.

All of the textfields are populated with the data from the database but 1. My Top textfield doesnt load the data correctly.
The data loaded into the textfield is always as such "org.webhop.ywdc.ImagesAction@197507c". The numbers after the @ symbol change, but it always
just loads the action classes location instead of the url. All the other textfields load the correct url string.

Ive checked the action classes "top" property, and the "top" property that the top textbox gets populated from is the correct url returned from the database, its just
that for some reason when the struts2 textbox gets populated, it loads the action classes location with an "@" symbol then some numbers instead of the url.
All of the other image textboxes get their url's loaded correctly (back, front, sidea, sideb, bottom).

Any ideas on what might be causing this???

Its all such a simple set up that I cant imagine what is going wrong.

Please help.

David


 
Ranch Hand
Posts: 247
MyEclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi David.

Can you show your Jsp ?

I guess if you are getting exact values from database...then you should check on the view side..

Regards,
Raza
 
David Brave
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Heres my jsp page. All of the textfields populate but the one called "top"
Like i said, in the action class, all of the image properties (top, bottom, sidea, sideb, front, back) have the correct string "url" values.






The page itsself is a dialogbox from struts-jquery plugin, but I dont see how this should effect the code logic.
http://code.google.com/p/struts2-jquery/wiki/DialogTag

Thanks for your help.
 
David Brave
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So I changed my action class property to imagetop, and now its working properly.
I have no idea why the textfield wasnt loading the value for the property when the name in the action class was "top",
but I do thank you for your response.

sincerely,

david.
 
Raza Mohd
Ranch Hand
Posts: 247
MyEclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
nice to know that you got your solution..
But i am not pretty sure that Why it was not coming With name top..?

 
There's a way to do it better - find it. -Edison. A better tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic