Slides 4-5 — two files are used here. This HTML page gets the user name and posts it to welcome.jsp, which reads it back with request.getParameter() inside a scriptlet.

index.html — the form

<form action="welcome.jsp">
    <input type="text" name="uname">
    <input type="submit" value="go"><br/>
</form>
The name="uname" is the key. When the form is submitted the browser sends uname=<whatever was typed> to the server, and request.getParameter("uname") fetches it back.

← Back to the example index