how to make a text field which acts as a search field without a submit button in java web application
<p>I have written a small java webapplication in spring mvc. I have a webpage which list a table from mysql db. </p>

<p><a href="https://i.stack.imgur.com/Zxha4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Zxha4.png" alt="webpage displaying information from db"></a></p>

<p>Now I want to have a test box which does search action on hitting keyboard enter without a button.</p>

<p>The code is as below</p>

<p>clientlist.jsp</p>

<pre><code>&lt;div class="container-fluid"&gt;
      &lt;div class="row"&gt;
        &lt;div class="col-sm-3 col-md-2 sidebar"&gt;
          &lt;ul class="nav nav-sidebar"&gt;
            &lt;li class="active"&gt;&lt;a href="#"&gt;Enterprise Applications &lt;span class="sr-only"&gt;(current)&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="#"&gt;Application Servers&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="#"&gt;WebServers&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="#"&gt;Clusters&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;

        &lt;/div&gt;
        &lt;div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main"&gt;
          &lt;h1 class="page-header"&gt;Clients&lt;/h1&gt;

          &lt;div class="table-responsive"&gt;

            &lt;table class="table table-striped"&gt;
               &lt;tr&gt;
                &lt;td&gt;&lt;%@ include file="/WEB-INF/jsp/globalfilter.jsp" %&gt;&lt;/td&gt;
               &lt;/tr&gt;
               &lt;thead&gt;
                 &lt;tr&gt;
                    &lt;th&gt;Application Name&lt;/th&gt;
                    &lt;th&gt;Client Type&lt;/th&gt;
                    &lt;th&gt;Client Name&lt;/th&gt;
                    &lt;th&gt;Hostname&lt;/th&gt;
                    &lt;th&gt;Environment&lt;/th&gt;
                 &lt;/tr&gt;
               &lt;/thead&gt;
               &lt;tbody&gt;
                 &lt;c:forEach items="${clientList}" var="client"&gt;
                    &lt;tr&gt;
                        &lt;td&gt;${client.applicationname}&lt;/td&gt;
                        &lt;td&gt;${client.clienttype}&lt;/td&gt;
                        &lt;td&gt;${client.clientname}&lt;/td&gt;
                        &lt;td&gt;${client.hostname}&lt;/td&gt;
                        &lt;td&gt;${client.envtype}&lt;/td&gt;
                    &lt;/tr&gt;
                 &lt;/c:forEach&gt;
               &lt;/tbody&gt;

            &lt;/table&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
</code></pre>

<p>globalfilter.jsp which has the search table</p>

<pre><code>&lt;body&gt;
    &lt;form:form action="client.do" method="POST" commandName="client"&gt;
      &lt;table&gt;
        &lt;tr&gt;
            &lt;td&gt;&lt;input type="text" name="clientname" /&gt;&lt;/td&gt;
            &lt;td colspan="2"&gt;
                &lt;input type="submit" name="action" value="Search" /&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/table&gt;
    &lt;/form:form&gt;
&lt;/body&gt;
</code></pre>

<p>ClientController.java</p>

<pre><code>@RequestMapping("/clientlist")
    public String clientPage(Map&lt;String, Object&gt; map){
        Client client = new Client();
        map.put("client", client);
        map.put("clientList", clientService.getAllClient());
        return "clientlist";
    }

@RequestMapping(value="/client.do", method=RequestMethod.POST)
    public String doActions(@ModelAttribute Client client, BindingResult result, @RequestParam String action, Map&lt;String, Object&gt; map){
        Client clientResult = new Client();
        boolean isSearch = false;
        switch(action.toLowerCase()){
        case "add":
            clientService.add(client);
            clientResult = client;
            break;
        case "edit":
            clientService.edit(client);
            clientResult = client;
            break;
        case "delete":
            clientService.delete(client.getClientname());
            clientResult = new Client();
            break;
        case "search":
            Client searchedClient = clientService.getClient(client.getClientname());
            clientResult = searchedClient!=null ? searchedClient : new Client();
            isSearch = true;
            break;
        }

        if(isSearch) {
            List&lt;Client&gt; list = new ArrayList&lt;Client&gt;();
            list.add(clientResult);
            map.put("clientList", list);
        } else {
            map.put("clientList", clientService.getAllClient());
            map.put("client", clientResult);
        }

        return "clientlist";
    }
</code></pre>

<p>Now I dont need a submit button "search" which does the action, how to achieve the search result by hitting enter key.</p>