Hi, can i have 2 servlets in a single page?I am having a screen in servlet which displays the details of the caller to the agent.I need to display in the same page about another caller if anyone is in queue by fetching the customer waiting database.How can i do this?any idea about this ?I thought to do it in html frames.one frame which displays the details screen and the other frame should display that a caller is waiting in queue by using servlet which checks the database for every five seconds whether anyone is in queue and displays the message to the agent.Is this method correct.If not how can i do this?
Frames would be one way to do this. You might also want to look into RequestDispatcher.include.
If you really want to delve into best practices, you should think about moving all of the heavy lifting out of your servlets and into beans or plain old Java objects. Look up the "model, view, controller" pattern or 'MVC' for more on this. Once you've done this, it would be easy to mix and match the results from several different components into your pages.
thanks.now i have done this in frame like i am having a html file which is having 2 frames.one is forward.jsp and another is custwait.jsp.In forward.jsp i am calling one servlet which is displayed in topframe consisting of pause and logout buttons.In custwait.jsp i am calling another servlet which just checking the database for every 5 seconds and displays some message at the bottom.If i click the logout button which is in the top frame,it is redirected to login page.but the bottom frame displays the following error:
HTTP Status 500 -
type Exception report
description The server encountered an internal error () that prevented it from fulfilling this request.