jQuery in Action, 2nd edition*
The moose likes Servlets and the fly likes how to capture dynamically generated value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to capture dynamically generated value" Watch "how to capture dynamically generated value" New topic
Author

how to capture dynamically generated value

pramodh somashekara
Ranch Hand

Joined: Jan 30, 2006
Posts: 62
Hi All,

I have a jsp page which displays a dynamically generated table of values which has two columns of information.

Column1 Column2
100 some info
200 some more info
300 some other info
...

The values 100, 200, 300 are all dynamically generated and can vary each time.

What I want to do is, whenever user clicks on any of these values (i.e. 100 or 200 or 300 etc), I should capture this value and pass it to the next jsp/servlet page for further processing.

Please let me know how I can capture this value whenever user click on any of these values.
[ April 15, 2006: Message edited by: Bear Bibeault ]
Vikrant Pandit
Ranch Hand

Joined: Mar 27, 2006
Posts: 245
Hi Pramod,

You can consider writing your table generation code as follows

<table>
// some logic to decide the number of rows generated
<tr>
<td><a href="yournextservlet?value=<%=value%>"><%=value%></a></td>
<td>Your info</td>
</tr>
</table>

Hope this helps

Vivek


Vikrant Pandit
pramodh somashekara
Ranch Hand

Joined: Jan 30, 2006
Posts: 62
Thanks Vivek Pandey, I am able to do it.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to capture dynamically generated value
 
Similar Threads
How to find a value from a graph image in .gif format
hyperlink-event using a servlet
JSp-urgent
ragarding usage of innerhtml
how to send 100's of textfields data to a servlet?