• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing an arrayList of JavaBean Object as hidden variables

 
rammie singh
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi every body...

i have a JSP page..where i get an ArrayList of objects. These objects are of type javabean type...say of class CapacityReqdBean.java.

Now my requirement is that i want to pass this arraylist to servlet....but don't know how to do it.
can i pass it through hidden variable .

i am not in a position to use session..because on jsp page i would be having different radio buttons....and each button would be representing an arrayList.

Finally on click of a radio button....that corresponding arrayList has to passed to the servlet where it would be passed to a function.


how can i achieve this..please help me.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Short answer: no.

Browsers only send strings. You can serialize/de-serialize somehow, or send IDs and re-create on the server side somehow, but the browser will send only strings back to the server.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Servlet API provides the session for passing references to objects to various servlets and JSP within the same web application.

This is all very basic stuff, have your read a tutorial on the servlet API?

Hidden variables are used in HTML pages to attach name-value pairs of strings to HTML form submission.

Bill
 
rammie singh
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi william
actually i didn't want to use session.
But still can you mention which servlet API is used for this purpose.....may be i can get the result.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64720
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
rammie singh wrote:because on jsp page i would be having different radio buttons....and each button would be representing an arrayList.

That makes no sense. A radio button con only represent a single string value. How is it representing an array list?
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:send IDs and re-create on the server side somehow.


Yes. it is an Easy way
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic