Yoav, I have written this code, but "srv" is always an empty array.
I use tomcat-5.0.19 Server server = ServerFactory.getServer(); Service service = server.findService("Catalina"); Service[] srv = server.findServices(); for (int i = 0; i < srv.length; i++) { Service s = srv[i]; log.debug("SERVICE: " + s.getName()); } Zsolt > -----Original Message----- > From: Shapira, Yoav [mailto:[EMAIL PROTECTED] > Sent: Friday, April 09, 2004 7:00 PM > To: Tomcat Users List > Subject: RE: How to start a Realm from a servlet or a filter > > > > Hi, > > >And how can I access or start a Realm? > > What is up with this list? Do people don't know how to read JavaDocs, > or do they simply not care? Sigh... > > Server server = ServerFactory.getServer(); > Service service = server.findService("Catalina"); > Container serviceContainer = service.getContainer(); > Realm serviceRealm = serviceContainer.getRealm(); // May be null > > You would/can continue to drill down from the service using findChildren > to locate Engine/Host/Context elements and their associated Realms, if > any. > > As to how to start one: look at the tomcat startup code, that's why it's > open-source. > > Yoav Shapira > > > > This e-mail, including any attachments, is a confidential > business communication, and may contain information that is > confidential, proprietary and/or privileged. This e-mail is > intended only for the individual(s) to whom it is addressed, and > may not be saved, copied, printed, disclosed or used by anyone > else. If you are not the(an) intended recipient, please > immediately delete this e-mail from your computer system and > notify the sender. Thank you. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]