I have implented the Front Controller pattern from the J2EE blueprints.
http://developer.java.sun.com/developer/technicalArticles/J2EE/despat/ However, it looks like I have to keep all the jsp files under /sample_app folder, which I don't like. Is there a way to implement the controller on jsp's at the root level(/)?
the web.xml for this is below
<web-app>
<!-- the web.xml file of the web component of the sample application -->
<!-- all other specs -->
<servlet>
<servlet-name>CentralEntryPoint</servlet-name>
<servlet-class>FrontControllerImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>CentralEntryPoint</servlet-name>
<!-- The following forces all web page requests of this
application to be routed through the front controller -->
<url-pattern>/sample_app/*</url-pattern>
</servlet-mapping>
<!-- all other specs -->
</web-app>