File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Vidya Gupta
Ranch Hand
Posts: 98
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 86
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 98
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


i got the output already..

Thanks for your reply..
 
Aggarwal Arpit
Ranch Hand
Posts: 86
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you used struts 1 or struts 2?
 
Vidya Gupta
Ranch Hand
Posts: 98
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


struts1
 
Aggarwal Arpit
Ranch Hand
Posts: 86
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you post your code, how you implemented that because I have to do the same..
 
Vidya Gupta
Ranch Hand
Posts: 98
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
Posts: 86
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Vidya for your post.......
 
Sandy Chatterjee
Ranch Hand
Posts: 55
Hibernate Java Mac
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

You can write:
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic