Sunday, February 19, 2006

JSP 2.0, MySQL Server and Tomcat 5.5

Installed JDK 1.5 by making it the first entry in the path variable. Oracle was pointing to JRE 1.3.
Installed Tomcat 5.5. This version runs as a windows service and does not have the usual start and stop tomcat features. Wonder why.
Installed the MySQL server. Created an admin account with admin as the password. My SQL server runs on port# 3306. During the creation of the account it failed to connect to the MySQL server because windows was blocking the port.
To allow the connection to the MySQL server port go to control panel -> firewall -> advanced and new configuration. Name the description of service as MySQL server and provide the name of your computer (or just say localhost, windows automatically changes it to the name of your computer). Enable the TCP/IP by giving the external port number as 10061 and internal port number as 3306. Save it. Now the configuration assistant will complete with no problem when you click on the "Retry" button.

Created a test table by following the Data Source configuration instructions for Tomcat 5.5. You have include a Context entry in the server.xml with data source configuration settings. You must also create a web.xml file. Deploy the test.jsp as war file. You will be able to run it and see the output of the JSTL tags which queries the table and shows the data in the table.

If you get exception related to JSTL tags then you must copy the JSTL tag related libraries to your WEB-INF/lib directory.

The new features of JSP and JSTL allows rapid development of dynamic web pages driven by database. This is a perfect solution for web apps that are just reporting tools with no business logic. In this case the application is simple and does not need a domain model, intergration tier etc.

No comments:

Post a Comment