How will you pass values from HTML page to the Servlet

Showing Answers 1 - 7 of 7 Answers

RIT

  • Jul 26th, 2005
 

There are some ways to Pass a value from a Html page to the servlet.. 
1. hidden variable 
2. appending to the link by usign name value pair. 

  Was this answer useful?  Yes

One question...

Can we encapsulate the values in the request object and pass using servlets so that the next servlet receive it..??
Or we can use session object to encapsulate the information as well right..?
Please clarify regarding the same.
Regards.
Jimmy514in

  Was this answer useful?  Yes

Abhi

  • Mar 4th, 2012
 

Here is the code

Code
  1.  request.setAttribute("attri_name","attrib_value");

  2. //u can set as many attributes as u want n retrieve it by "request.getAttribute("attrib_name");

  3. RequestDispatcher rd=request.getRequestDispatcher();

  4. rd.forward(request,response);

  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