This code is not submitting to a form? Why

Posted by Ankur on Stack Overflow See other posts from Stack Overflow or by Ankur
Published on 2010-03-08T08:26:24Z Indexed on 2010/03/08 8:36 UTC
Read the original article Hit count: 214

Filed under:
|
|
|

Since I am using get I expect to see the submitted values appended to the queryString but instead all I see is the URL of the servlet being called with nothing added at the end.

<form id="editClassList" name="editClassList" method="get" action="EditClassList">
    <%
        HashMap<Integer,String> classes = new HashMap<Integer,String>();
        classes = (HashMap<Integer,String>) request.getAttribute("classes");
    %>
    <% 
        if(classes.size()==0){  %>
        <label><input class="small-link" type="text" id="add-this-class"
                      size="42" value="" /></label>     
    <%
        }

    %>
    <%
            Set<Integer> classIds = new HashSet<Integer>();
            classIds = classes.keySet();
        Iterator<Integer> itr = classIds.iterator();
        while(itr.hasNext()){
            int nextId = (Integer)itr.next();
        %>
            <label><input class="small-link" type="text" id="<% out.print(nextId); %>"
                          size="42" value="<% out.print(classes.get(nextId)); %>" />
            </label> 
            <img id="add-class" src="images/add.png" width="16" height="16" /><br />
        <label><input class="small-link" type="text" id="class-to-add"
                  size="42" value="" /></label>     
    <%
        }
    %>
    <label><input type="submit" id="save-class-btn" value="Save Class(es)" /></label>
</form>

© Stack Overflow or respective owner

Related posts about java

Related posts about servlet