tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harish <hari...@postmark.net>
Subject Re: which classes to use to modify server.xml
Date Tue, 14 Mar 2000 09:28:38 GMT
[P.S. Hi Justyna, the archives told me that you developed the "context
admin" interface. Hope you can help me and so i'm copying it to you -
thanks for y'r attention - harish]

Hi costin,
		Thanks for the info. That really helped! 
	Looked into the 3.1 beta RC1 version. saw the context admin interface.
NOW: When i add a context using this interface, it doesn't modify
"server.xml". Ideally, shouldn't it be adding a <context></context>
entry in server.xml? It doesn't. 
I'll tell what exactly i did:
        I added a context named - "myapp" with a war file named
bank.war(which was in c:\my_folder\WAR\). When i tried accessing the
jsp's in it, tomcat said - file not found. When i restarted it and
tried, nothing happened.
        I copied the war file into "c:\program files\apache
group\jakarta-tomcat\webapps\" and then tried the whole thing. This
time: I got file not found when i accessed the jsps. I stopped tomcat
and checked the webapps directory - there was a folder with the name
"bank" into which all the jsps/servlets were extracted into. I
re-started tomcat now and now when i listed down the contexts, i got the
context name "bank", instead of "myapp". Now, i could access the
jsp/serlvets in bank.jar properly.

My questions are:
1) How is tomcat getting in the context "bank" when there is no entry in
server.xml. Is it because tomcat "picks" the contexts from "webapp"
directory rather than server.xml or am i missing something? Has
"server.xml" been deprecated?  :) :)

2) Do i have to copy the WAR file into "c:\program files\apache
group\jakarta-tomcat\webapps\" to use the Context Admin interface to add
new contexts?

In case of any small prob.s/improvements with Context Admin, may be i
can fix/make them(if none is working on it at present).

Thanks for the help,
harish

costin@eng.sun.com wrote:
> 
> >       It isn't HttpServer, but AdminImpl.java that i have overridden. I have
> > added a method getHttpServer() which return me the ref. to the
> > HttpServer that AdminImpl contains. From the HttpServer reference, i get
> > the CM and so on.
> 
> > >      I'm doing a look up in the RMI Registry to get a reference to the
> > > HttpServer(Tomcat "HttpServer" class) running[All my program  knows is
> > > the host/port number of the registry].I have overridden the
> > > HttpServer.java, added a "getContextManager()" method using which i get
> > > a ref. to the context Manager. This,i use to get the info all the
> > > contexts i wish to modify(or delete etc.)
> 
> You are using an old version of tomcat.
> Get 3.1beta and take a look at the admin interface.
> ( it's going to have a user/password and run on a different port ).
> 
> You just need to write a normal servlet and make a normal http connection
> to your servlet. Inside the servlet you'll access the real Request object
> and get the ContextManager.
> 
> Please note that all this will require special permissions for your
> servlet, and will be protected by a SecurityManager.
> 
> Costin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org

Mime
View raw message