import javax.servlet.http.HttpServletRequest; import java.util.Enumeration; public class MyServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) { EnumerationIn this example, we first obtain the Enumeration object of all parameter names in the current request using the getParameterNames() method of the HttpServletRequest object. We then iterate over the Enumeration and print the name of each parameter to the console. The package library for this class is javax.servlet.http.parameterNames = request.getParameterNames(); while (parameterNames.hasMoreElements()) { String paramName = parameterNames.nextElement(); System.out.println("Parameter Name: " + paramName); } } }