This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Struts and the fly likes dynamically checked radio button in struts1.3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "dynamically checked radio button in struts1.3" Watch "dynamically checked radio button in struts1.3" New topic
Author

dynamically checked radio button in struts1.3

Vaishali Paramane
Ranch Hand

Joined: Mar 05, 2007
Posts: 107
Hi
I am using struts1.3 and I want to checked gender radio button dynamically.
I have session attribute sex if sex value is male radio button should choose male or if sex values is female radio button should choose female.

How should I do it in jsp page in struts1.3?

Thanks for help


SCJP, SCJD
Preparing for SCWCD
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32635
    
215

Are you using Struts form tags for the radio buttons? If so, have your Action set the form value to male/female. If not, your JSP could use an if statement tag (Struts or JSTL tag) to set the selected attribute.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Vaishali Paramane
Ranch Hand

Joined: Mar 05, 2007
Posts: 107
following is my code


I set session attribute from database. I know I can do through strut-config file but I want to do dynamically.

do you know how I can do it?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: dynamically checked radio button in struts1.3
 
It's not a secret anymore!