This test is intended to solve a serious security problem, where mixed case or additional characters in a file name can get Tomcat to serve the source file instead of the processed file for JSP files on a Windows platform. This test should be replaced with a solution that doesn't have the above side effects. You need to study carefully the trace at the server window to find out more about the error. These errors can occur while translating your jsp source to a servlet. These are translation-time errors and occur mostly because of some syntax error in the jsp file or in the generated java file.
Errors can also occur at request-time.
If you are using JDK 1.1.x it will automatically be included. All other classes, jar files that are needed, are put by the startserver script and you don't need to worry about them. If your server is already running, you will need to stop and restart it. A new application can be added to Tomcat by editing server.xml file. And finally restart the server.