• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to run static html pages in tomcat4.1.24

 
Narasimha Reddy
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,
i am iam installing Apache Tomcat 4.1.24.I am write a static html page ,in that a text to be entered.After clicking the submit button to handle a servlet to get the parameter of the text.
In form action="http:\localhost:8080\examples\servlet\Handleget"

Where should i place html page and where should i place servlet class.

Please give detaile descreption to handle servlets in Tomcat4.1.24.

regards,
Narasimha reddy.
 
Babar Qadri
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Narasimha

place your html pages in example directory and palce your classes in WEB-INF/classes directory

i hope it will work
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Narasimha,
I've written some small example apps that you can just drop into the webapps directory of a running instance of Tomcat and run. Any one of these will show you the proper directory structure for a Servlet/JSP app along with simple examples of how to map servlets in web.xml.
Simple Servlet Example

In a nutshell, your directory structure should look like this.
Under the TOMCAT_HOME/webapps directory:

yourapp/ <-- JSPs, HTML, CSS, etc
yourapp/WEB-INF <-- Deployment Descriptor (web.xml)
yourapp/WEB-INF/lib <-- Any additional libraries (jar files)
yourapp/WEB-INF/classes/yourpackage/ <-- your servlet/bean classes

I don't recommend that beginners start writing their own code in the examples section of Tomcat for three reasons.

1.) All the JSPs in that app are pre-compiled so changing the JSP source code doesn't do anything. This leads to confusision for the new developer.

2.) J2EE apps are supposed to be autonomous entities. It's better to start out on the right foot.

3.) You will want to keep the examples in good working order so you can refer to them later.
[ December 30, 2004: Message edited by: Ben Souther ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!