**** Creating A Stable Tomcat Web Site(June/2003)
****
(I)Use The Java Standard Tags(JSTL) Instead Of Writing Your Own Java Code....
(see question below for why you should switch)
(II)How To
Handle MYSQL Databases....
(III)How To Handle POSTGRESQL Databases....
- tags: use <sql> tags included in the JSTL
- driver: http://jdbc.postgresql.org/download.html(the
standard driver)
- docs: http://jdbc.postgresql.org/doc.html
- web.xml file example:
<web-app>
<context-param>
<param-name>javax.servlet.jsp.jstl.sql.dataSource</param-name>
<param-value>jdbc:postgresql://localhost/DATABASE_NAME,org.postgresql.Driver,USER,PASSWORD</param-value>
</context-param>
</web-app>
- note: example untested(derived from MYSQL example)
(IV)How To
Handle Email Sending....
(V)How
To Handle Operations Not Yet Implemented In The JSTL...
- You can incorporate java code into your JSTL page if necessary
- You can write your own custom tag libraries
(1)Why should I switch to JSTL when I know how to code java?
- It provides proven web page stability.
- There is no need to worry about error handling.
- It is easy to learn.
- Tags are the present/future of web site development.
- Tags put .jsp on the same playing field as .asp and .php.
- Sun java has plans to make jsp
2.0(comming soon) synonymous with JSTL.
(2)What version of Tomcat does JSTL work with?
- JSTL website says tested with Tomcat 4.0.4 - But I have had no troubles
using JSTL 1.0.3 with 4.1.18 or 4.1.24.
- Tomcat 5.0(comming soon) is designed for JSTL and has it built in.
(3)How can I make my JSTL pages load faster?
- Reduce the number of lines in your .jsp page by putting multiple tags on
the same line.
- Break large pages into 2 smaller pages.
- Use Cascading
Style Sheets to reduce redundant html tags(always a good idea).
- You should always write code with speed in mind no matter what language
you use.
(4)Any miscellaneous things I should know?
- If you web page becomes extra-long it will not compile and will not tell
you the real compile error.
- Use JSTL for the 99% of the things it can do, and incorporate java
programming for the 1% it can't do.