problem with combobox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • smitanaik
    New Member
    • Oct 2007
    • 26

    problem with combobox

    <%ResultSet rset;
    String value = new String (request.getPar ameter("options "));
    %>
    <%
    {
    if(value.equals ("a"))%>
    <%
    rset=empsbean.g etaaa();
    %>


    <p>
    &nbsp;
    </p>
    <div align="center">
    <table cellspacing="2" cellpadding="3" border="1">
    <tr>


    <th width="47%">
    <div align="center">
    sites
    </div>
    </th>
    <th width="47%">
    <div align="center">
    data
    </div>
    </th>
    </tr>
    <%while (rset.next ())
    {
    out.println("<t r>");
    out.println("<t d>" +
    rset.getString( "ip") + "</td><td>" +
    rset.getInt("da ta_r") + "</td><td> " +

    "</td>");
    out.println("<t r>");
    }

    }
    %>
    </table>
    </div>
    </p>




    when i click on particular options all else part results are displayed.

    how to select paricular options
  • ajos
    Contributor
    • Aug 2007
    • 283

    #2
    Originally posted by smitanaik
    <%ResultSet rset;
    String value = new String (request.getPar ameter("options "));
    %>
    <%
    {
    if(value.equals ("a"))%>
    <%
    rset=empsbean.g etaaa();
    %>


    <p>
    &nbsp;
    </p>
    <div align="center">
    <table cellspacing="2" cellpadding="3" border="1">
    <tr>


    <th width="47%">
    <div align="center">
    sites
    </div>
    </th>
    <th width="47%">
    <div align="center">
    data
    </div>
    </th>
    </tr>
    <%while (rset.next ())
    {
    out.println("<t r>");
    out.println("<t d>" +
    rset.getString( "ip") + "</td><td>" +
    rset.getInt("da ta_r") + "</td><td> " +

    "</td>");
    out.println("<t r>");
    }

    }
    %>
    </table>
    </div>
    </p>




    when i click on particular options all else part results are displayed.

    how to select paricular options

    Use code tags, difficult to read this way. In this particular problem, i dont see a else part.

    Do all the business logic in the servlet/action class. The way you are doing it will be difficult to debug the problem, i've learned the hard way. Use jstl tags for display purpose.

    Edit: the way you are starting/closing the scriptlet is a mess. Check that.


    regards.
    Last edited by ajos; Apr 23 '08, 09:45 AM. Reason: extra point added.

    Comment

    Working...