This post originated from an RSS feed registered with Java Buzz
by Goldy Lukka.
Original Post: J2EE Presentation layer (HTML) best practices - I
Feed Title: Xyling Java Blogs
Feed URL: http://www.javablogs.xyling.com/thisWeek.rss
Feed Description: Your one stop source for Java Related Resources.
Now that I have started writing some stuff relating to J2EE and Server side performance and best practices, I decide to write more in-depth and comprehensive set of information on how to really enhance the performance on each layer of J2EE application.
To start with Presentation Layer, today I write a few HTML best practices. JSP and Servlets best practices would then follow.
The short and sweet list of HTML Best Practices:
1. Include closing tags (as recommended by the HTML specification) even when if the browsers do not require them. This is not a performance enhancing tip but surely a presentation enhancement tip. If you intentionally/unintentionally miss to close vital tags like div, tr, td etc., it can wreck havoc for the user seein your sophestically designed page. 2. Avoid using deprecated HTML tags. (See title of this post for the latest spec). 3. Use lowercase letters for all HTML tags. 4. Don't use frames. (Why you Shouldn't use Frames). Also read this interesting Are you licensed to use HTML frames? forum discussion. 5. Don't use images for text. 6. Don't link to index (default) files. (Link to directories instead). This will help you migrate to other default file without any change in code. 7. Don't use font tags. (Use CSS instead.) 8. Use descriptive document titles. (In case you want search engines to pay special attention to your site). 9. Compress (Gzip) and send bigger HTML pages. Browsers are capable of uncompression. This will ease some server load. (I will be writing more on this while writing jsp/servlet tips for filtering data). 10. Try to follow, as far as possible, the latest HTML specs as strictly as possible.
For more information on XHTML 1.0 that is (HTML 4.0 in XML 1.0) specifications, turn to the tile of this post.
[Resource-Type: Tips; Category: Java/J2EE; XRating: you do :) ]