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

Posted on 2007-10-04
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

    <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...

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Suggested Solutions

    Title # Comments Views Activity
    has22 challenge 11 56
    lucky13 challenge 11 96
    wordsFront challenge 8 47
    mapShare challenge 13 40
    I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
    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.

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now