I have a desktop application from where a client can add a new user, can chat with other user etc… I have 2 options now:
- To make a handler servlet which will get post request on
according to request the handler servlet will call required
servlet(e.gloginServlet,chatServlet,addUserServletetc) - Directly call the required servlet from client e.g make direct
request to chatServlet forchat,loginandaddUser
Remember my client side is a desktop application. Which method is good for implementing and future enhancements.
Thank you
Well,I think you should go with the 1 st Approach by using Front Controller pattern.
It should consist of only a SINGLE SERVLET which provides a centralized entry point for all requests.This servlet will delegate all request to the required servlet.
You need to do only following thing to apply the front controller pattern in your application: