Article:
 |
|
Deploying Web Applications to Tomcat
|
| Subject: |
|
What is the file name of Listing 4 |
| Date: |
|
2002-11-17 14:14:48 |
| From: |
|
anonymous2
|
|
|
|
Hi,
I am a newbie to Servlets and JSP but I have a few questions forsomebody who has completed the tutorial can answer.
1. What is the file name of listing 4. Is is
login.java or com.onjava.login.java?
2. James' article says
To deploy a servlet as part of a web application you first need to compile the servlet and move it into the web application's /WEB-INF/classes directory. For this example, you should compile this servlet and move it to the /onjava/WEB-INF/classes/com/onjava/ directory.
This class file is in the subdirectory com.onjava because of its package name.
So........ we do create an subdirectory called
/onjava/WEB-INF/classes/com/onjava/
This is not a typo?
3. Is he statement below correct?
This class file is in the subdirectory com.onjava because of its package name.
should this say "/com/onjava" not com.onjava
could somedy explain this for me
Thanks in advance
stephanj@melbpc.org.au
|
Showing messages 1 through 1 of 1.
-
What is the file name of Listing 4
2003-03-06 07:53:05
anonymous2
[View]
I created the subdirectory com\onjava and tried to compile com.onjava.login.java from there. I get a compile error:
com.onjava.login.java:8: class login is public, should be declared in a file named login.java
public class login extends HttpServlet {
^
1 error
Stuck so early on, too! Please help...and if anyone can give me a step-by-step of how to set classpath (Tomcat? Java?) to not create that problem with the HttpServlet thing, as many people have asked, I would be really grateful. I'm currently compiling all code like this:
~>javac -classpath ".;C:\Project\Apache Tomcat 4.0\common\lib\servlet.jar" nameoffile.java
Thanks to anyone who can spare a minute for a confused newbie.