| Author |
how to run static html pages in tomcat4.1.24
|
Narasimha Reddy
Greenhorn
Joined: Oct 05, 2004
Posts: 11
|
|
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.
|
Narasimha Reddy
|
 |
Babar Qadri
Ranch Hand
Joined: Oct 12, 2004
Posts: 51
|
|
hi Narasimha place your html pages in example directory and palce your classes in WEB-INF/classes directory i hope it will work
|
babar
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
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 ]
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
 |
|
|
subject: how to run static html pages in tomcat4.1.24
|
|
|