File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Front Controller Servlet" Watch "Front Controller Servlet" New topic

Front Controller Servlet

Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 573
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.

Peter den Haan
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: 573
Thanks I will go for the struts framework.

It is sorta covered in the JavaRanch Style Guide.
subject: Front Controller Servlet
Similar Threads
using stateful and stateless session bean together, what happens?
Does your book cover J2EE patterns
JSPs and the Controller
Asking authors about the patterns in Web Tier
MVC (urgent)