O'Reilly logo

Sams Teach Yourself J2EE™ in 21 Days by Peter Roxburgh, Andy Longshaw, Debbie Law, Dan Haywood, Martin Bond

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Comparing JSP with Servlets

As you have seen JSPs have several advantages over servlets. They

  • Are quicker to write and develop

  • Focus on the page layout and delegate Java logic to supporting JavaBeans and custom tags (as will be discussed on Day 14)

  • Differentiate the Web page presentation (HTML) from the underlying logic (Java)

  • Can be written by non-Java–aware developers provided suitable supporting beans and tag libraries are available

  • Support a standard error reporting mechanism using the error page directive

However, JSPs do have some downsides:

  • Error identification and correction is complicated by the translate and compile lifecycle.

  • Large volumes of embedded Java scriptlets can reduce the maintainability of the page.

In general, you should use ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required