Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How do you pass the data from one servlet to another
servlet?

Answer Posted / kuru

for example if you want to pass your name from one servlet
to another,

in fiest servlet file....

String name = "Tom"
request.setAttribute("name",name);

RequestDispatcher dis = request.getRequestDispatcher
("Servlet2");

request.Forward(request,response);



in second servlet file....

request.getAttribute("name");
//this line will display "Tom"

Is This Answer Correct ?    46 Yes 20 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how to improve Servlet Performance?

1147


What are the functions of the servlet container?

1628


What is session tracking?

1213


If my browser does not support cookie, and my server sends a cookie instance what will happen?

1104


What is the difference between the http servlet and generic servlet?

1148


Why servlet is used as controller ? Not JSP? I want complete explation?

1137


Which interface should be implemented by all servlets?

1221


Explain in brief the directory structure of a web application?

1112


What is the use of servlet context?

1046


Why HttpServlet class is declared abstract?

1223


What is http servlet?

1068


If servlet receives multiple requests, how many objects will it create?

1386


What are the steps involved in placing a servlet within a package?

1079


How do we translate jsp?

1057


What is difference between PrintWriter and ServletOutputStream?

1294