Let's say I got a delete Button on my jsp site which has the following code:
<button type="button" class="btn btn-xs btn-danger">
<span class="glyphicon glyphicontrash" aria-hidden="true"></span> Delete </button></a>
String movieID = request.getParameter("movieID");
In a GET request, you can give parameters to a request by using a query string. A query string is a
? followed by name-value pairs such as
movieID=Foo. In this case, the value of
Foo. If you want more than one name-value pair, put an
& between them.
When you submit a
form, it creates these parameters for you. So if you were to submit this form:
<form method="GET" action="deleteMovie"> <input type="hidden" name="movieID" value="Foo" /> <input type="submit" /> </form>
It would generate a URL of
deleteMovie?movieID=Foo and then send it off.