getContextPath, getServletPath, getPathInfo return values

2001-04-30 Thread Lu, Spencer

Hi,

I'm running Tomcat 3.2.1 on Windows NT.  In my server.xml I have defined a
Context for my web app and the path is set to "/".  In my web.xml my servlet
maps to "/*".  In my servlet I make calls to getContextPath(),
getServletPath(), and getPathInfo().  When I access
http://localhost:8080/Login.htm, here are the values that are returned by
the calls:

getContextPath(): empty string
getServletPath(): empty string
getPathInfo(): /Login.htm

But when I run my web app under BEA Weblogic Server, I get the following
values:

getContextPath(): empty string
getServletPath(): /Login.htm
getPathInfo(): null

I'm just wondering why Tomcat and Weblogic return different values, and
which one is correct.

Thanks,
Spencer 



Why does servlet need to be in a subdir of WEB-INF/classes?

2001-04-17 Thread Lu, Spencer

Hi,

I've noticed that a servlet class invoked by Tomcat must reside in a
subdirectory of /WEB-INF/classes.  Ideally I would like to be able
to place my servlet class in a directory that is not under WEB-INF/classes.
Is there any way to do this without changing the Tomcat source and
recompiling it?  If not, does anyone know why the developers coded Tomcat
this way, instead of just loading the servlet from a directory in the
classpath?  Just curious.  Thanks.

Spencer




How to execute a class on startup (Tomcat 3.2.1) ?

2001-04-16 Thread Lu, Spencer

Hi,

I'm wondering how I can have Tomcat 3.2.1 execute a class (not a servlet)
when it starts up.

Thanks.

Spencer




RE: A couple of questions

2001-04-13 Thread Lu, Spencer

OK, I have just read the Servlet Specification 2.2, and it does not answer
my first question, which was:

When I go to the Servlet Examples page
(http://localhost:8080/examples/servlets/index.html), there is a link that
executes the Hello World servlet.  This link is
http://localhost:8080/examples/servlet/HelloWorldExample.  How does Tomcat
know that when it sees "/examples/servlet/" in the URL, it is supposed to
look in the examples/WEB-INF/classes directory for the
HelloWorldExample.class file?  I haven't been able to find anything in the
server.xml or web.xml files that shows how this is configured.

I see no servlet mappings in any of the configuration files that maps a
servlet to "/examples/servlet/HelloWorldExample".

Please tell me how this is set up.

Thanks,
Spencer

-Original Message-
From: Filip Hanik [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 11, 2001 7:37 PM
To: [EMAIL PROTECTED]
Subject: RE: A couple of questions


first things first,
you will have 90% of your questions answered by reading the servlet
specification from Sun.
this answers question 1 for you

> 2) Would it be possible for me to place my application in a completely
> separate directory tree and not in a war file?  Or does it have to be in a
> war file in the webapps directory?

yes, you will just have to setup classpaths etc properly for servlets and
other classes.
The server.xml file allows you to configure other contexts outside of the
webapps directory.

Filip



~
Namaste - I bow to the divine in you
~
Filip Hanik
Software Architect
[EMAIL PROTECTED]
www.filip.net

> -----Original Message-
> From: Lu, Spencer [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 11, 2001 4:29 PM
> To: '[EMAIL PROTECTED]'
> Subject: A couple of questions
>
>
> Hi,
>
> I've recently installed Tomcat 3.2.1 (win32) on my computer.  I'm
> trying to
> understand how certain things are configured, and I have a couple of
> questions:
>
> 1) When I go to the Servlet Examples page
> (http://localhost:8080/examples/servlets/index.html), there is a link that
> executes the Hello World servlet.  This link is
> http://localhost:8080/examples/servlet/HelloWorldExample.  How does Tomcat
> know that when it sees "/examples/servlet/" in the URL, it is supposed to
> look in the examples/WEB-INF/classes directory for the
> HelloWorldExample.class file?  I haven't been able to find anything in the
> server.xml or web.xml files that shows how this is configured.
>
> 2) Would it be possible for me to place my application in a completely
> separate directory tree and not in a war file?  Or does it have to be in a
> war file in the webapps directory?
>
> Thanks for your help,
> Spencer
>
>



A couple of questions

2001-04-11 Thread Lu, Spencer

Hi,

I've recently installed Tomcat 3.2.1 (win32) on my computer.  I'm trying to
understand how certain things are configured, and I have a couple of
questions:

1) When I go to the Servlet Examples page
(http://localhost:8080/examples/servlets/index.html), there is a link that
executes the Hello World servlet.  This link is
http://localhost:8080/examples/servlet/HelloWorldExample.  How does Tomcat
know that when it sees "/examples/servlet/" in the URL, it is supposed to
look in the examples/WEB-INF/classes directory for the
HelloWorldExample.class file?  I haven't been able to find anything in the
server.xml or web.xml files that shows how this is configured.

2) Would it be possible for me to place my application in a completely
separate directory tree and not in a war file?  Or does it have to be in a
war file in the webapps directory?

Thanks for your help,
Spencer