Tomcat

How to configure Tomcat dynamically .. if so give me a example ?
[78 byte] By [sube] at [2007-9-26 1:15:15]
# 1

Hi Sube,

Please visit this site.

http://www.jguru.com/forums/view.jsp?EID=409278

There they have provided how to configure the Tomcat with source code.

Any how I have attached the same thing from the site

Re: Re: Re: Is it possible to dynamically configure Tomcat?

Topic: Tomcat

Ivo Limmen, May 8, 2001

This is the source I used to obtain all the current active web application running in Tomcat 3.2.1. I hop this is usefull for you.

import java.util.Enumeration;

import java.util.ArrayList;

import javax.servlet.http.*;

import org.apache.tomcat.core.Request;

import org.apache.tomcat.core.FacadeManager;

import org.apache.tomcat.core.Context;

import org.apache.tomcat.core.ContextManager;

import org.apache.tomcat.util.RequestUtil;

public class ContextTree {

private ContextManager cm;

public ContextTree(HttpServletRequest request) {

FacadeManager facadeM = (FacadeManager)request.getAttribute( FacadeManager.FACADE_ATTRIBUTE);

if (facadeM == null) {

cm = null;

return;

}

this.cm = facadeM.getRealRequest(request).getContext().getContextManager();

}

public WebLink[] getContextNames() {

ArrayList list = new ArrayList();

Enumeration e = cm.getContexts();

while(e.hasMoreElements()) {

Context c = (Context)e.nextElement();

if(c.getDocBase().indexOf("ROOT") == -1) {

WebLink wl = new WebLink(c.getDescription(), c.getDocBase());

list.add(wl);

}

}

WebLink[] temp = new WebLink[list.size()];

list.toArray(temp);

return temp;

}

}

I hope this will help you.

Thanks

Bakrudeen

Technical Support Engineer

Sun MicroSystems Inc, India

bakrudeen_indts at 2007-6-29 0:41:25 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Hi subesee below link http://www.jguru.com/faq/view.jsp?EID=425653 so you will get lot enough info about your query.. its available directely.Regards,TirumalaraoDeveloper Technical Support,Sun MicroSystem,India.
rao_indts at 2007-6-29 0:41:25 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
thanks to both sun guys
sube at 2007-6-29 0:41:25 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...