Example of simple application using a hosted Tomcat environment

Recently I got a hosting package with jsp capabilities that are running under Tomcat 5.5.16.  I think the server is running just fine because the following .jsp file give the output "2 + 2 = 4":

<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"
    prefix="c" %>

<html>
<head><title>Localized Dates</title></head>
<body bgcolor="white">
2 + 2 = <%= 2 + 2 %>
</body>
</html>

The servlet engine document directory is as follows:

jsp
  ROOT
    META-INF
    WEB-INF
    index.jsp

My problem is that I've read about the deployment directory structure several times without fully implementing an example.  I think a good resource about the server/deployment environment is at:
http://tomcat.apache.org/tomcat-5.5-doc/appdev/deployment.html

What I want to do is setup a simple app that is making use of packages and/or libraries so that I can get the hang of this structure.  For instance, the following example by weblogic has a Calendar.jsp file that uses the CalendarBean class to do a simple page that displays a calendar.  I've tried it a couple of ways but I keep getting errors.  I don't think it would help to list them because I would like to learn from a clean example.
http://www.weblogic.com/docs51/intro/intro_jsp.html

Could someone please provide either a link to or an example of creating a simple application where the meat of the example is in the using the deployment structure to load classes, libraries and packages as opposed to the code itself. Thank you very much.
wsbdc-questionsAsked:
Who is Participating?
 
JavatmConnect With a Mentor Commented:
You can use netbeans to develop and run your web application. You dont need any thing else this IDE has it all even a built-in tomcat. Once
your able to develop one you can just put the tar file("Compressed Apps") of your application to the tomcat/webapp
folder to be deployed on your site.

Here is a document that can kick start your needs : http://www.netbeans.org/kb/50/quickstart-webapps.html
You can download netbeans here : http://www.netbeans.info/downloads/download.php?type=5.0
0
 
evnafetsConnect With a Mentor Commented:
I think all that is missing from that weblogic example, is that fact that your classes should be deployed under the WEB-INF/classes directory, in their package structure.
So the bean example.intro.CalendarBean should be in the directory: /WEB-INF/classes/examples/intro/CalendarBean.class

The standard Structure in Tomcat would be
[TOMCAT]
--webapps      
   --[myContext]
      --index.jsp
      --WEB-INF
         --web.xml

Most times you won't be deploying under the root context, but rather under your own context directory.
I find that this tutorial is also an excellent intro for the basics: http://www.coreservlets.com/Apache-Tomcat-Tutorial/
     
0
 
rrzConnect With a Mentor Commented:
If you are going to use a Servlet 2.4 header in your context's web.xml , then you can use  
<html>
<head><title>Localized Dates</title></head>
<body bgcolor="white">
2 + 2 = ${2 + 2}
</body>
</html>
0
All Courses

From novice to tech pro — start learning today.