More JSP best practices

JSP advancements ease development of standardized, highly maintainable JSP-based applications

1 2 3 Page 3
Page 3 of 3

Technical dependencies do not always make vendor-specific features potentially risky. Custom tag libraries provided by Web server vendors may work on any Web server that fully supports custom tags, but you must be wary of licensing issues in these cases.

This best practice's significance depends on the likelihood of switching Web servers. When I am not using Tomcat as my Web server, I occasionally deploy my J2EE-based Web applications against this reference Web server implementation to verify specification compliance. Keep in mind that using vendor-specific features can be risky even if you stay with the same vendor for an extended time period. This is because the rapidly improving J2EE specifications often address issues in a standard way after vendors have made the features popular in their own proprietary way. In those cases, the vendors typically move to the standardized approach with future product versions.

Use XHTML syntax

In "JSP Best Practices," I recommended using HTML best practices in your JSPs. More specifically, I now find that the XHTML specification offers the most useful version of HTML tag syntax in authoring JSP documents. XHTML provides for HTML syntax that is entirely XML compatible, making it the perfect HTML tag syntax for developing XML-compliant JSP documents. Even JSP page authors will likely find it advantageous to use XHTML tag syntax in their JSPs.

To be completely XML-compliant, XHTML tag syntax must follow stricter rules than standard HTML tag syntax. The stricter requirements and the differences between standard HTML and XHTML tags are outlined in the World Wide Web Consortium's XHTML 1.0 pages.

It only gets better

JSP technology was originally created to simplify flexible Web development. Recent advancements such as JSTL have continued this trend. Even improvements in the servlet specification (such as filters) have strengthened JSP development convenience. The advancements in the JSP and servlet specifications, along with the advent of new development tools and sharing of JSP coding standards and conventions, have made highly maintainable JSP development easier than ever.

Dustin Marx is a senior software engineer and J2EE architect at Raytheon Company in Aurora, Colo. He has been working with JSP and J2EE technology for three years and has been heavily involved in object-oriented software development for seven years. He has a master's degree in business administration and a bachelor's degree in electrical engineering.

Learn more about this topic

1 2 3 Page 3
Page 3 of 3