Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图在我的网络应用程序中实现一个搜索栏:
<form method="get" action="NewServlet"> <input type="search" /> </form>
当我在此搜索栏中输入内容并按 Enter 键时,URL 将从
http://localhost:8084/App-1/tester.jsp
至
http://localhost:8084/App-1/NewServlet?
为什么我在 URL 中看不到搜索查询参数?
您必须命名您的字段:
<input type="search" name="query"/>
这将调用:
http://localhost:8084/App-1/NewServlet?query=...