Note that there are some explanatory texts on larger screens.

plurals
  1. POjquery autocomplete showing no search results although in response
    primarykey
    data
    text
    <p>I am trying to implement jquery autocomplete in a java/jsp project.</p> <p>The autocomplete function executes properly even takes the term to the server. The server sends the necessary response too that is visible in developer tools. The problem is that autocomplete is showing <code>No search results</code> even after getting the response.</p> <p>Here is my ajax jsp page - <strong>ajaxOtherLocations.jsp</strong> - where I am querying for results.</p> <pre><code>&lt;% String query = (String)request.getParameter("term"); System.out.println(query); LocationDAO locationModel = new LocationDAO(); ArrayList&lt;LocationBean&gt; locations = locationModel.getLocationsByType("others"); for( LocationBean location : locations ) { out.print(location.getLocationName()+"\n"); } %&gt; </code></pre> <p>In developer tools in network tab I can see that a request is being sent to the above page and response is something like...</p> <pre><code>LBNagar Hitech City Jubilee Hills Film Nagar Lakdikapool Koti Dilsukhnagar </code></pre> <p>All separated by <code>line-end</code> character as you can see.</p> <p>I am calling the <code>autocomplete</code> function like this...</p> <pre><code>$(".auto-complete").keypress(function(){ $(this).autocomplete({source:"ajax/ajaxOtherLocations.jsp"}); }); </code></pre> <p>Where am I doing wrong?</p> <p>NOTE: - I took ideas from this tutorial - <a href="http://www.java4s.com/jquery-tutorials/example-get-autocomplete-feature-in-javajsp-with-jquery-api/" rel="nofollow">http://www.java4s.com/jquery-tutorials/example-get-autocomplete-feature-in-javajsp-with-jquery-api/</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload