I need to pass information from a String variable that is on a JSP page to a Servlet. For example:
String path="C: \ test.jpg";
How do I get this information in the Servlet?
I need to pass information from a String variable that is on a JSP page to a Servlet. For example:
String path="C: \ test.jpg";
How do I get this information in the Servlet?
To get the value of a form field or parameter value of a query string, use the getParameter()
method of the request
object.
url: www.teste.com?parametro=teste
How to get the value in the servlet:
String param = request.getParameter("parametro");
If the value is an integer or another type, a type conversion is required because the http protocol works only with text or everything is a string.