Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


How to manipulate controls from JSP to Servlet? (JSTL)

Posted on 2007-10-04
Medium Priority
Last Modified: 2013-11-24

I have a JSP where I have three html controls:

1. A href with an image for search action (now I just tried with a input type image).
2. A textbox to enter a search string.
3. A submit button ..

<form   action="../DecDivSelect" method="get">
            <table border="0" cellpadding="4" cellspacing="1" width="100%">
                  <tr bgcolor="#8c9faa">
                        <td width="50" align="center" valign="middle" bgcolor="#8c9faa"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage                                    ('ClearFilter','','../images/icon_clearfilter_over.gif',1)"><img src="../images/icon_clearfilter.gif" alt="Clear Filter" width="19" height="17" hspace="1" border="0" align="absmiddle"       id="ClearFilter" /></a></td>
                        <td width="50"align="center" valign="middle" bgcolor="#8c9faa"><input type="image" src="../images/icon_filter_over.gif" onmouseout="MM_swapImgRestore()"                   onmouseover="MM_swapImage('Filter','','../images/icon_filter_over.gif',1)"></td>
                        <td><input name="txtFundMgrCodeFilter" type="text" maxlength="20" /></td>
                  <tr class="datatext">
                  <td colspan="2" align="center" nowrap="nowrap" class="td_columnheader">
                        <span class="datacolumn_header">Select</span>&nbsp;&nbsp;
                          <td class="td_columnheader">
                                <span class="datacolumn_header"><a href="#">Fund Manager</a></span>
              <c:forEach var="fmlistItem" items="${fmlist}">
<input type="radio" name="fund_manager_id" value="<c:out value="${fmlistItem.fundManagerId}" />"/><c:out value="${fmlistItem.managerDescription}" /><br/>
<c:out value="${fmlistItem.fundManagerId}" />

<input type="submit" name="EE" value="Process" > //this is the control 3

Now here is what I want to do:

Initially, I have the page only with the controls 1 and 2.
Once a search string is entered and the href in clicked (now the input type image) , I populate a list of objects with radio buttons at the bottom of the controls 1 and 2 in this same page
I have the action of the form set to DecDivSelectservlet.

Now, once I select an item from the radio button, I want to submit to the same servlet DecDivSelectand do some processing and forward it to a different JSP from the servlet.

Now I can't seem to do the last part...

I was able to resubmit to the same page .. now how do I , for submit button (3) submit to the same servlet ?

I need some logic to do that.

I am trying not to use much javascript....

Question by:_Esam
1 Comment
LVL 19

Accepted Solution

Kuldeepchaturvedi earned 1000 total points
ID: 20018817
<input type="radio" name="fund_manager_id" onclick = "document.forms[0].submit();" value="<c:out value="${fmlistItem.fundManagerId}" />

should submit it back after selecting the radio button...

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question