configuring auto loading webapps (tomcat 4.0.3)

2002-06-20 Thread Dan Diodati



Is there a way to 
configure each autoloading webapp without having to add an entry to the 
server.xml?
I know that webapps 
are autoloaded from the webapps directory, the problem is that I need to 
configure a
custom loader for 
each webapp and I don't want to change the server.xml for each new webapp(we 
will have 
lots of them). The 
older tomcat had support to configure different context's in different files, 
which would get added to
the server.xml 
during runtime. With tomcat 4.0.3 they seem to have lost this feature.I 
tried to use the DefaultContext
configuration but it 
does not seem to accept a Loader setting. Anyone know of a way around 
this?
 
  



 Dan 
Diodati [EMAIL PROTECTED] Senior Software Engineer 
NightFire Software     
 

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


RE: Servlet knowing its own URL

2002-06-25 Thread Dan Diodati


I believe you have to access the HttpServletRequest object(
getContextPath(), etc ). The getServletName() just returns then webapp name
set in the web.xml file.


-Original Message-
From: Mike Jackson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 25, 2002 9:33 AM
To: Tomcat Users List
Subject: RE: Servlet knowing its own URL


You can get the name from getServletName, I think the rest of what
you're looking for can be acquired from the servlet context, but
I might be wrong.

--mikej
-=-
mike jackson
[EMAIL PROTECTED]

> -Original Message-
> From: Shapira, Yoav [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 25, 2002 9:20 AM
> To: [EMAIL PROTECTED]
> Subject: Servlet knowing its own URL
>
>
> Howdy,
> I'm probably missing something basic here ;)  But how can a Servlet know
> its own URL at startup, before any requests are sent to it?
>
> More specifically, if I have a webapp MyApp, and a servlet MyServlet,
> accessible as
> http://myhost.mydomain:myport/MyApp/MyServlet
>
> I would like MyServlet's init() method to figure out that its context is
> at
> http://myhost.mydomain:myport/MyApp
>
> Any ideas, suggestions etc. much appreciated ;)
>
> Yoav Shapira
> Millennium ChemInformatics
>
>
>
> --
> To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Servlet knowing its own URL

2002-06-25 Thread Dan Diodati


Check out the following mehtod from ServletContext:

(cut from javadoc)
getRealPath
public java.lang.String getRealPath(java.lang.String path)Returns a String
containing the real path for a given virtual path. For example, the path
"/index.html" returns the absolute file path on the server's filesystem
would be served by a request for "http://host/contextPath/index.html";, where
contextPath is the context path of this ServletContext.. 


-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 25, 2002 9:42 AM
To: Tomcat Users List
Subject: RE: Servlet knowing its own URL


Howdy,
Thank you for the suggestions.  However, my question is how to do this
in the absence of any requests.  This is for the init() method, so I do
have the servlet context and the servlet config, though.  The context
name is one part, but I need the host, port, etc.

All ideas appreciated,

Yoav Shapira
Millennium ChemInformatics


>-Original Message-
>From: Dan Diodati [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, June 25, 2002 12:38 PM
>To: 'Tomcat Users List'
>Subject: RE: Servlet knowing its own URL
>
>
>I believe you have to access the HttpServletRequest object(
>getContextPath(), etc ). The getServletName() just returns then webapp
name
>set in the web.xml file.
>
>
>-Original Message-
>From: Mike Jackson [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, June 25, 2002 9:33 AM
>To: Tomcat Users List
>Subject: RE: Servlet knowing its own URL
>
>
>You can get the name from getServletName, I think the rest of what
>you're looking for can be acquired from the servlet context, but
>I might be wrong.
>
>--mikej
>-=-
>mike jackson
>[EMAIL PROTECTED]
>
>> -Original Message-
>> From: Shapira, Yoav [mailto:[EMAIL PROTECTED]]
>> Sent: Tuesday, June 25, 2002 9:20 AM
>> To: [EMAIL PROTECTED]
>> Subject: Servlet knowing its own URL
>>
>>
>> Howdy,
>> I'm probably missing something basic here ;)  But how can a Servlet
know
>> its own URL at startup, before any requests are sent to it?
>>
>> More specifically, if I have a webapp MyApp, and a servlet MyServlet,
>> accessible as
>> http://myhost.mydomain:myport/MyApp/MyServlet
>>
>> I would like MyServlet's init() method to figure out that its context
is
>> at
>> http://myhost.mydomain:myport/MyApp
>>
>> Any ideas, suggestions etc. much appreciated ;)
>>
>> Yoav Shapira
>> Millennium ChemInformatics
>>
>>
>>
>> --
>> To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
>
>
>
>--
>To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
>
>--
>To unsubscribe, e-mail:   <mailto:tomcat-user-
>[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:tomcat-user-
>[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>