• 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
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

How to get values in Java bean

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
my problem is i have objects in JSP having the same name with different id's..ex <input type="checkbox" name="sample" id="1" value="some value"> <input type="checkbox" name="sample" id="2" value="some value">. How will i declare and get the values of that objects on my bean saying i have a SampleBean and my setter and getter methods like getSample() and setSample()? How can i get the values of all of that objects having same names in my bean? thanks in advance!
[ April 27, 2006: Message edited by: Bear Bibeault ]
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
how many beans you are using for this applications?

as you have mentioned id="1" and id="2". are these two beans?
just explain what you want to do.

if these are beans then use
jsp:usebean with getProperty(); with id.
...........
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are you getting while doing request.getParameter("1") and request.getParameter("2")?
[ April 27, 2006: Message edited by: Adeel Ansari ]
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic