tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Younes El Moumen" <Younes.ElMou...@ton-art.de>
Subject list Tomcat 5.0 deployed applications with jsp.
Date Wed, 21 Jul 2004 14:22:54 GMT
Hi all,

I'm using this way to list the deployed applications throw jsp. can anyone tell me if there
is a better way to do that(without substring because that might cause some errors):



        Registry registry=Registry.getRegistry();
        MBeanServer mBeanServer =Registry.getRegistry().getServer();
        java.util.Set set = mBeanServer.queryNames(new ObjectName("Catalina:type=Manager,*"),
null);
        java.util.Iterator it = set.iterator();
                while (it.hasNext()) {
                    String kunde=it.next().toString();
                    kunde = kunde.substring((kunde.indexOf('/')+1),(kunde.lastIndexOf(',')));
			}


the substring() catches only the name as for example:

Catalina:type=Manager,path=/helloweb,host=localhost

will list "helloweb"


Thanks.

Younes

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


Mime
View raw message