This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Struts and the fly likes How to use Bean tag library to get values from a drop down list in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "How to use Bean tag library to get values from a drop down list in jsp" Watch "How to use Bean tag library to get values from a drop down list in jsp" New topic
Author

How to use Bean tag library to get values from a drop down list in jsp

Vidya Gupta
Ranch Hand

Joined: Mar 18, 2012
Posts: 96

Hi,

Am having a small problem.. In my jsp am having 2 drop down lists that is city and state drop down lists.. Here am selecting one city and state and submitting the page.. Nw i want to display the 2 values(city and state) which i selected.. But am unable to do this.. Please correct me if i wrong..



Here if use bean:write tag it is not displaying the result.. Here what tag should i use to capture the selected values and displaying.. Please correct me..

Thanks,
Vidya
Aggarwal Arpit
Ranch Hand

Joined: Mar 04, 2012
Posts: 86
Try this link if it is useful to you
http://www.mkyong.com/struts2/struts-2-sselect-drop-down-box-example/

Vidya Gupta
Ranch Hand

Joined: Mar 18, 2012
Posts: 96


i got the output already..

Thanks for your reply..
Aggarwal Arpit
Ranch Hand

Joined: Mar 04, 2012
Posts: 86
you used struts 1 or struts 2?
Vidya Gupta
Ranch Hand

Joined: Mar 18, 2012
Posts: 96


struts1
Aggarwal Arpit
Ranch Hand

Joined: Mar 04, 2012
Posts: 86
can you post your code, how you implemented that because I have to do the same..
Vidya Gupta
Ranch Hand

Joined: Mar 18, 2012
Posts: 96


Actually i dnt know whether it is correct or not.. but i did like this.. I had taken two different properties for year, moth and date in FormBean and i retrieved both the attributes.

DOB = <bean:write name="employeeform" property="dob_year" />
<bean:write name="employeeform" property="dob_month" />
<bean:write name="employeeform" property="dob_date" />
<br />
Aggarwal Arpit
Ranch Hand

Joined: Mar 04, 2012
Posts: 86
Thanks Vidya for your post.......
Sandy Chatterjee
Ranch Hand

Joined: Jun 27, 2012
Posts: 55


You can write:


Take up one idea. Make that one idea your life; dream of it; think of it; live on that idea. Let the brain, the body, muscles, nerves, every part of your body be full of that idea, and just leave every other idea alone. This is the way to success.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How to use Bean tag library to get values from a drop down list in jsp
 
Similar Threads
html:select help
onLoad in DispatchAction
How to retain the selected values of a dropdown in the result page using JSP and servlet
Do disable an option in drowdown
Drop Down Box in Struts - Select Default Value Implementation