Forum Stats

  • 3,768,738 Users
  • 2,252,843 Discussions
  • 7,874,704 Comments

Discussions

JSP and call a java class

coco
coco Member Posts: 673

Hi,

Is it possible that in fjsp to have something like this?

When I am trying it nothing happens.

<body>

        <form name="myForm" action="newjsp.jsp" method="post" >

            <h1>Hello World!</h1>

            <table>

                <tr>

                    <td>

                        <input type="text" name="nm" >

                        <button type='button' onclick="<%CustomerFromDatabase tfd = new CustomerFromDatabase(request.getParameter("nm"));%>;"> submit</button>

                        <select >

                                <%                                            

                                    Iterator tertiIterator = tfd.getTerti().entrySet().iterator();

                                    while(tertiIterator.hasNext()){

                                            Map.Entry<String, String> entry = (Map.Entry) tertiIterator.next();

                                            %><option value="<%= entry.getValue() %>"><%= entry.getValue() %></option>

                                <%  }

                                %>

                        </select></td>

                    <td>b1</td>

                    <td>c1</td>

                </tr>

            </table>

        </form>  

</body>

If I try TertiFromDatabase tfd = new CustomerFromDatabase("test") instead of  CustomerFromDatabase(request.getParameter("nm")) it will populate the html list.

Thank you

Tagged:
This discussion has been closed.