This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts 2: Strange <s:textfield> prepopulation issue. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2: Strange <s:textfield> prepopulation issue." Watch "Struts 2: Strange <s:textfield> prepopulation issue." New topic
Author

Struts 2: Strange <s:textfield> prepopulation issue.

Alia Huss
Ranch Hand

Joined: Feb 13, 2009
Posts: 63
Hello!

When clicking a link for updating user information one of 6 fields doesn't get populated.

Here's the jsp code:
UpdateUser.jsp

The <s:textfield> that doesn't get populated is "phone"

In my action class I have the following code:


When the action's execute is called the value of phone is set with a value Ex. 0708090909

Any idea why this particular field isn't getting populated?
I can't see any typo's and by debugging I have established that the value of phone (in the action class) is set to something (not null and not an empty String)

Thanks
Alia
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

We'd have to see more information; I don't see anything obvious that would cause it not to be populated.
Alia Huss
Ranch Hand

Joined: Feb 13, 2009
Posts: 63
It was a typo afterall, I had set the getter as private, not public.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Teh <s:debug/> tag might help. Posting the config and action could also provide a clue.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Struts 2: Strange <s:textfield> prepopulation issue.
 
Similar Threads
problem in printing the values
unable to get next form
NullPointerException at the SessionFactory create line.
struts2 textfield tag not populating with correct value from action class
Combobox question.