Jumat, 05 Mei 2017

How do we retrieve parameters in Java Servlets

It is common in web applications to pass data or parameters from one to another page. To retrieve the values of various elements in a HTML form or from another page, we can use the following methods which are available in HttpServletRequest object: String getParameter(String  name) Enumeration getParameterNames() String getParamterValues(String  name)   Following example demonstrates retrieving data from a login page to a servlet: login.html 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 <!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://ift.tt/2ewFFOU; <html> <head> <meta http-equiv=“Content-Type” content=“text/html; charset=ISO-8859-1”> <title>Login</title> </head> <body> <form action=“auth.html” method=“get”>

The post How do we retrieve parameters in Java Servlets appeared first on Coding Security.


How do we retrieve parameters in Java Servlets
read more

Tidak ada komentar:

Posting Komentar