aspose file tools*
The moose likes Servlets and the fly likes Front Controller Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Front Controller Servlet" Watch "Front Controller Servlet" New topic
Author

Front Controller Servlet

Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 579
I have a front controller servlet which uses the if else format to request JSPs. This is ok if you are dealing with a small number of JSPs.

What I would like is a pointer to a link of a better way to implement the Front Controller Servlet that has many JSPs.

Thanks for any help.

Tony
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
What about Struts or the Spring MVC framework? No use reinventing the wheel...

- Peter
Chad McGowan
Ranch Hand

Joined: May 10, 2001
Posts: 265
If using a framework like struts is not an option, you could create a HashMap that would map action parameter keys and Action classes/and or jsps. That would get rid of your long if/else statements that you have now.
Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 579
Thanks I will go for the struts framework.

Tony
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Front Controller Servlet