English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Hi all,
I have a java file named Ch1Servlet.java under project1/src directory
there is classes directory project1/classes and web.xml under src directory
project1/src directory.
Now to compile i have to give %javac -classpath /your path/tomcat/common/lib/servlet-api.jar -d classes src/Ch1Servlet.java
What is this your path ? Tomcat 5.0 is installed in C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib with servlet-api.jar
Please help me out.
Best Regards
Taton


import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class Ch1Servlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
PrintWriter out = response.getWriter();
java.util.Date today = new java.util.Date();
out.println(""+""+"

HF\'s Chapter 1 Servlet

"+"
"+today+""+"");
}
}

2006-09-06 21:57:56 · 2 answers · asked by K Ban 2 in Computers & Internet Programming & Design

2 answers

K ban try this link and learn

http://www.coreservlets.com/Apache-Tomcat-Tutorial/

2006-09-06 23:32:44 · answer #1 · answered by Joe_Young 6 · 0 0

place u r virtual directory in webapps folder
put ur classes file as below
web-apps
virtual directory(projects)
WEB-INF
web.xml,Classes(Folder)
ur java compiled .class files

2006-09-07 06:29:49 · answer #2 · answered by ch_nagarajind 3 · 0 0

fedest.com, questions and answers