Setting priority of Servlets

Setting priority of Servlets

Postby SHilpy » Thu Feb 07, 2013 9:02 pm

There can be more than one servlets for a particular web application.
Is it possible to have a scenario when we want that a particular servlet should be executed first ?
And in that case, can we set a priority to a Servlet?
Posts: 6
Joined: Thu Jan 31, 2013 2:34 am

Re: Setting priority of Servlets

Postby Kishan » Fri Feb 08, 2013 3:34 pm

This is more common to fulfill the request.

Sometimes to process request you might required to execute one or more servlets.
Some of this servlets might be produce static content which you would like combine with dynamic content.
Some times you can separate business logic and presentation logic to execute in different servlets.

Above can be achieved by using request.getRequestDispatcher():
#1 include() combine multiple servlets output
#2 forward() executes multiple servlets and sends only one servlet output back to browser.
Posts: 191
Joined: Tue Jan 29, 2013 4:21 am

Return to Servlets

Who is online

Users browsing this forum: No registered users and 2 guests