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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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: 556
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: 556
Thanks I will go for the struts framework.

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