You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Alec Swan <al...@gmail.com> on 2006/11/02 00:36:45 UTC

accessing settings in server.xml from the servlet

Hi,

how can a servlet access maxThreads settings defined in server.xml? I
tried getServletContext(), getServletConfig(), getInitParameter(..),
getAttribute(..), etc, but I still can't find a way to access
server.xml
configuration. I guess I need to get ahold of the catalina engine and
the get the setting from the http connector. But what is the right way
to
do this?

Thanks.

Alec

Re: accessing settings in server.xml from the servlet

Posted by Mark Thomas <ma...@apache.org>.
Alec Swan wrote:
> Is it possible to get ahold of catalina engine from the servlet code and
> then somehow inspect http connectors?

Take a look at
http://wiki.apache.org/tomcat/HowTo#head-42e95596753a1fa4a4aa396d53010680e3d509b5

Mark


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: accessing settings in server.xml from the servlet

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Alec Swan [mailto:alecswan@gmail.com] 
> Subject: Re: accessing settings in server.xml from the servlet
> 
> Is there a way to access settings in server.xml without 
> MBeans?

Other than rolling your own infrastructure, probably not, at least not
easily.  That's what MBeans are for and why Tomcat utilizes them.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: accessing settings in server.xml from the servlet

Posted by Alec Swan <al...@gmail.com>.
Charles ,

I agree with you that this starting point is rather terse.

Is there a way to access settings in server.xml without MBeans? I would like
to write a simple servlet that doesn't require special configuraion, such as
mbeans-descriptor.xml file.

Is it possible to get ahold of catalina engine from the servlet code and
then somehow inspect http connectors?

Thanks.


On 11/1/06, Caldarale, Charles R <Ch...@unisys.com> wrote:
>
> > From: Alec Swan [mailto:alecswan@gmail.com]
> > Subject: accessing settings in server.xml from the servlet
> >
> > how can a servlet access maxThreads settings defined in server.xml?
>
> Usually via JMX.  This is your rather terse starting point:
> http://tomcat.apache.org/tomcat-5.5-doc/mbeans-descriptor-howto.html
>
> Look at code in Tomcat's manager and admin apps for examples.
>
> - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

RE: accessing settings in server.xml from the servlet

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Alec Swan [mailto:alecswan@gmail.com] 
> Subject: accessing settings in server.xml from the servlet
> 
> how can a servlet access maxThreads settings defined in server.xml?

Usually via JMX.  This is your rather terse starting point:
http://tomcat.apache.org/tomcat-5.5-doc/mbeans-descriptor-howto.html

Look at code in Tomcat's manager and admin apps for examples.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org