Pass values from HTML page to the Servlet

How to pass values from HTML page to the Servlet?

Questions by shilpamj

Showing Answers 1 - 3 of 3 Answers

we can pass html data  to servlet using getParameter() method


for example  in doPost(......

public void doPost(HttpServletRequest request, HttpServletResponse response)
   throws ServletException, IOException {


// reads text field data named as fname
 String name=request.getParameter("fname").trim();
}



}

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions