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 / debojit

First of all u have to set the value by setAttribute()
method such as:
request.setAttribute("variableName",object);

Then u have to forward that request to other servlet by
using that procedure,

ServletContext con=request.getServletContext();
RequestDispatcher rd=con.getRequestDispatcher("/servlet");
rd.forward(request,response);

U can get that information from that servlet by using the
method::
getAttribute("variableName");

Is This Answer Correct ?    50 Yes 20 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is lazy loading and what is Generic Servlet Class?

1127


How we can get ip address of client in servlet?

1029


Why do we need a constructor in a servlet if we use the init method?

1099


Is servlet a controller?

1055


What are the kinds of http requests?

1097


what is the different between a servlet and a cgi? Why do you go for servlet rather than cgi?

1101


What is the capacity the doget can send to the server?

1131


What is meant by Servlet? What are the parameters of service method?

1101


Why do you use session tracking in httpservlet?

1196


Why doesn’t a servlet include main()?

1103


Can filter be used as request or response?

1011


When a client request is sent to the servlet container, how does the container choose which servlet to invoke?

1079


What is the difference between the servlets and cgi programs?

1045


What if we pass negative value in load-on-startup?

1334


How to notify an object in session when session is invalidated or timed-out?

1129