I am currently using a front controller pattern for my servlet and utilize a large if-else if structure in the doGet()
and doPost()
methods; however, my application is starting to add more and more functionality and as result the if-else blocks are getting out of control. I was wondering what are some popular strategies for handling this type of situation (while maintaining a front controller).
All I could think to do was maybe use a hashtable that maps paths (from the request url) to helper methods that determines the appropriate JSP (and sets attributes).
I liked the look of the Spring framework; however, I am currently not able to port to a framework, how does something like Spring avoid the problem I am facing?