previous |
start |
next
Handling Request Parameters
- When a browser submits a form, it sends the names and values of
all form elements to the web server
- The name is city
- the value is the contents of the text field
- The action attribute of the form element
specifies the URL of the server-side program that processes the
form
- In this case timezone.jsp
- In a JSP page, you can access the form data through the
predefined request object
- The getParameter method of the ServletRequest
class returns the value of the form element with a given name
- To get the city that the user typed
- <%= request.getParameter("city")%>
previous |
start |
next