saplingPro
saplingPro

Reputation: 21329

why don't I see the query parameter when I hit enter in the search bar?

I was trying to implement a search bar in my web application:

<form method="get" action="NewServlet">
    <input type="search" />
</form>

When I type something in this search bar and hit enter, then the URL changes from

http://localhost:8084/App-1/tester.jsp

to

http://localhost:8084/App-1/NewServlet? 

Why don't I see the search query parameter in the URL?

Upvotes: 2

Views: 44

Answers (1)

Tomasz Nurkiewicz
Tomasz Nurkiewicz

Reputation: 340933

You have to name your field:

<input type="search" name="query"/>

This will call:

http://localhost:8084/App-1/NewServlet?query=...

Upvotes: 3

Related Questions