This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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>
I think so, Yes. I have jsp files at the application root (http://localhost:8080/myapp/test.jsp) but they are not running the front controller. Only the jsp under the http://localhost:8080/myapp/sampleapp/ directory run the front controller. How do I make all jsp under the webapp run the front controller? I tried putting the servlet mapping to "/*" but then I got an endless redirect when the front controller forwards to the target. [ January 11, 2002: Message edited by: Ray Lim ]