BEA WebLogic Server™ 8.1 Unleashed
by Mark Artiges, Gupreet Singh Bhasin, Bernard Ciconte, Malcolm Garland, Saranathan Govindarajan, James Huang, Subramanian Kovilmadam, Kunal Mittal, Paul J. Perrone, Tom Schwenk, Steve Steffen
Best Practices for Implementing Servlets
As we've seen, servlets offer a powerful mechanism for integrating Web servers and enterprise-wide business components. Now let's look at some of the best practices that are adopted in enterprise applications that involve servlets as one of the layers.
Leverage the MVC pattern— Use servlets as controllers, as described in the MVC pattern. Presentation is typically done using a JSP and the servlet is left to invoke the business component and pass on the necessary data for the presentation layer.
Use of SingleThreadModel— SingleThreadModel servlets should be avoided because most of the servlet container implementations have a huge system overhead. Instead use thread synchronization when necessary.
Use
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access