Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JSP and call a java class

cocoNov 13 2015 — edited Nov 13 2015

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

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Dec 11 2015
Added on Nov 13 2015
0 comments
725 views