Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To transfer a value entered into an input text to a variable in JSP, you can use the request.getParameter() method. This method retrieves the value of the specified parameter from the HTTP request.

For example, to transfer the value entered into an input text field with the name "myText", you can use the following code:

<%
  String myVar = request.getParameter("myText");
%>

This code retrieves the value of the "myText" parameter and assigns it to the "myVar" variable. You can then use this variable in your JSP code to display or manipulate the value as needed.