You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Asif Jan <as...@cern.ch> on 2003/05/09 11:36:02 UTC

How to use Tomcat API in a web application

Hello
I have a web service which needs to check if a given session ID is valid (ie
still live in a tomcat container).

I beleive I can do it through Manager application in Catalina.
I want to access the Manager object associated with Catalina instance that I
am running my web service on.

I faild to figure out how I can get reference to Catalina enviroement
through API.

I do not want to use HTTP access for manager application but will prefer the
API access.

Thanks
Asif

-----Original Message-----
From: tomcat-user-help@jakarta.apache.org
[mailto:tomcat-user-help@jakarta.apache.org]
Sent: Friday, May 09, 2003 11:32 AM
To: asif.muhammad@cern.ch
Subject: WELCOME to tomcat-user@jakarta.apache.org


Hi! This is the ezmlm program. I'm managing the
tomcat-user@jakarta.apache.org mailing list.

I'm working for my owner, who can be reached
at tomcat-user-owner@jakarta.apache.org.

Acknowledgment: I have added the address

   asif.muhammad@cern.ch

to the tomcat-user mailing list.

Welcome to tomcat-user@jakarta.apache.org!

Please save this message so that you know the address you are
subscribed under, in case you later want to unsubscribe or change your
subscription address.


--- Administrative commands for the tomcat-user list ---

I can handle administrative requests automatically. Please
do not send them to the list address! Instead, send
your message to the correct command address:

To subscribe to the list, send a message to:
   <to...@jakarta.apache.org>

To remove your address from the list, send a message to:
   <to...@jakarta.apache.org>

Send mail to the following for info and FAQ for this list:
   <to...@jakarta.apache.org>
   <to...@jakarta.apache.org>

Similar addresses exist for the digest list:
   <to...@jakarta.apache.org>
   <to...@jakarta.apache.org>

To get messages 123 through 145 (a maximum of 100 per request), mail:
   <to...@jakarta.apache.org>

To get an index with subject and author for messages 123-456 , mail:
   <to...@jakarta.apache.org>

They are always returned as sets of 100, max 2000 per request,
so you'll actually get 100-499.

To receive all messages with the same subject as message 12345,
send an empty message to:
   <to...@jakarta.apache.org>

The messages do not really need to be empty, but I will ignore
their content. Only the ADDRESS you send to is important.

You can start a subscription for an alternate address,
for example "john@host.domain", just add a hyphen and your
address (with '=' instead of '@') after the command word:
<to...@jakarta.apache.org>

To stop subscription for this address, mail:
<to...@jakarta.apache.org>

In both cases, I'll send a confirmation message to that address. When
you receive it, simply reply to it to complete your subscription.

If despite following these instructions, you do not get the
desired results, please contact my owner at
tomcat-user-owner@jakarta.apache.org. Please be patient, my owner is a
lot slower than I am ;-)

--- Enclosed is a copy of the request I received.

Return-Path: <as...@cern.ch>
Received: (qmail 18995 invoked from network); 9 May 2003 09:31:38 -0000
Received: from mail7.cern.ch (137.138.138.162)
  by daedalus.apache.org with SMTP; 9 May 2003 09:31:38 -0000
Received: from PCCMS157 (pccms157.cern.ch [137.138.178.231])
	by mail7.cern.ch (8.12.1/8.12.1) with SMTP id h499VoJ3017971
	for
<tomcat-user-sc.1052472682.fbccjclbnblojipbkami-asif.muhammad=cern.ch@jakart
a.apache.org>; Fri, 9 May 2003 11:31:50 +0200 (MET DST)
X-Authentication-Warning: mail7.cern.ch: Host pccms157.cern.ch
[137.138.178.231] claimed to be PCCMS157
From: "Asif Jan" <as...@cern.ch>
To:
<tomcat-user-sc.1052472682.fbccjclbnblojipbkami-asif.muhammad=cern.ch@jakart
a.apache.org>
Subject: RE: confirm subscribe to tomcat-user@jakarta.apache.org
Date: Fri, 9 May 2003 11:31:50 +0200
Message-ID: <NH...@cern.ch>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0)
In-Reply-To: <10...@jakarta.apache.org>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Importance: Normal
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N



-----Original Message-----
From: tomcat-user-help@jakarta.apache.org
[mailto:tomcat-user-help@jakarta.apache.org]
Sent: Friday, May 09, 2003 11:31 AM
To: asif.muhammad@cern.ch
Subject: confirm subscribe to tomcat-user@jakarta.apache.org


Hi! This is the ezmlm program. I'm managing the
tomcat-user@jakarta.apache.org mailing list.

I'm working for my owner, who can be reached
at tomcat-user-owner@jakarta.apache.org.

To confirm that you would like

   asif.muhammad@cern.ch

added to the tomcat-user mailing list, please send
an empty reply to this address:


tomcat-user-sc.1052472682.fbccjclbnblojipbkami-asif.muhammad=cern.ch@jakarta
.apache.org

Usually, this happens when you just hit the "reply" button.
If this does not work, simply copy the address and paste it into
the "To:" field of a new message.

or click here:

mailto:tomcat-user-sc.1052472682.fbccjclbnblojipbkami-asif.muhammad=cern.ch@
jakarta.apache.org

This confirmation serves two purposes. First, it verifies that I am able
to get mail through to you. Second, it protects you in case someone
forges a subscription request in your name.

Some mail programs are broken and cannot handle long addresses. If you
cannot reply to this request, instead send a message to
<to...@jakarta.apache.org> and put the
entire address listed above into the "Subject:" line.


--- Administrative commands for the tomcat-user list ---

I can handle administrative requests automatically. Please
do not send them to the list address! Instead, send
your message to the correct command address:

To subscribe to the list, send a message to:
   <to...@jakarta.apache.org>

To remove your address from the list, send a message to:
   <to...@jakarta.apache.org>

Send mail to the following for info and FAQ for this list:
   <to...@jakarta.apache.org>
   <to...@jakarta.apache.org>

Similar addresses exist for the digest list:
   <to...@jakarta.apache.org>
   <to...@jakarta.apache.org>

To get messages 123 through 145 (a maximum of 100 per request), mail:
   <to...@jakarta.apache.org>

To get an index with subject and author for messages 123-456 , mail:
   <to...@jakarta.apache.org>

They are always returned as sets of 100, max 2000 per request,
so you'll actually get 100-499.

To receive all messages with the same subject as message 12345,
send an empty message to:
   <to...@jakarta.apache.org>

The messages do not really need to be empty, but I will ignore
their content. Only the ADDRESS you send to is important.

You can start a subscription for an alternate address,
for example "john@host.domain", just add a hyphen and your
address (with '=' instead of '@') after the command word:
<to...@jakarta.apache.org>

To stop subscription for this address, mail:
<to...@jakarta.apache.org>

In both cases, I'll send a confirmation message to that address. When
you receive it, simply reply to it to complete your subscription.

If despite following these instructions, you do not get the
desired results, please contact my owner at
tomcat-user-owner@jakarta.apache.org. Please be patient, my owner is a
lot slower than I am ;-)

--- Enclosed is a copy of the request I received.

Return-Path: <as...@cern.ch>
Received: (qmail 18885 invoked from network); 9 May 2003 09:31:22 -0000
Received: from mail7.cern.ch (137.138.138.162)
  by daedalus.apache.org with SMTP; 9 May 2003 09:31:22 -0000
Received: from PCCMS157 (pccms157.cern.ch [137.138.178.231])
	by mail7.cern.ch (8.12.1/8.12.1) with SMTP id h499VYJ3017837
	for <to...@jakarta.apache.org>; Fri, 9 May 2003 11:31:34
+0200 (MET DST)
X-Authentication-Warning: mail7.cern.ch: Host pccms157.cern.ch
[137.138.178.231] claimed to be PCCMS157
From: "Asif Jan" <as...@cern.ch>
To: <to...@jakarta.apache.org>
Subject: RE: failure notice
Date: Fri, 9 May 2003 11:31:35 +0200
Message-ID: <NH...@cern.ch>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0)
In-Reply-To: <20...@smtp3.cern.ch>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Importance: Normal
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N



-----Original Message-----
From: MAILER-DAEMON@apache.org [mailto:MAILER-DAEMON@apache.org]
Sent: Friday, May 09, 2003 11:31 AM
To: asif.muhammad@cern.ch
Subject: failure notice


Hi. This is the qmail-send program at apache.org.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

<to...@jakarta.apache.org>:
ezmlm-reject: fatal: Sorry, I don't accept message with empty Subject
(#5.7.0)

--- Below this line is a copy of the message.

Return-Path: <as...@cern.ch>
Received: (qmail 18477 invoked from network); 9 May 2003 09:30:29 -0000
Received: from mail7.cern.ch (137.138.138.162)
  by daedalus.apache.org with SMTP; 9 May 2003 09:30:29 -0000
Received: from PCCMS157 (pccms157.cern.ch [137.138.178.231])
	by mail7.cern.ch (8.12.1/8.12.1) with SMTP id h499UfJ3016818
	for <to...@jakarta.apache.org>; Fri, 9 May 2003 11:30:42 +0200 (MET
DST)
X-Authentication-Warning: mail7.cern.ch: Host pccms157.cern.ch
[137.138.178.231] claimed to be PCCMS157
From: "Asif Jan" <as...@cern.ch>
To: <to...@jakarta.apache.org>
Subject:
Date: Fri, 9 May 2003 11:30:42 +0200
Message-ID: <NH...@cern.ch>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0)
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Importance: Normal
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: How to use Tomcat API in a web application

Posted by Tim Funk <fu...@joedog.org>.
There really is no developer API to get into tomcat like there are for thrid 
party products.

The manager application also does not accomplish your goal.

You'll need to write a new webapp. The webapp will need to be a "privledged" 
webapp so it may access the internal catalina classes.

The manager servlet should provide some insight on your exact needs. The 
manager servlet is  ManagerServlet.java.


-Tim

Asif Jan wrote:
> Hello
> I have a web service which needs to check if a given session ID is valid (ie
> still live in a tomcat container).
> 
> I beleive I can do it through Manager application in Catalina.
> I want to access the Manager object associated with Catalina instance that I
> am running my web service on.
> 
> I faild to figure out how I can get reference to Catalina enviroement
> through API.
> 
> I do not want to use HTTP access for manager application but will prefer the
> API access.
> 
> Thanks
> Asif


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org