On Tue, Jan 22, 2002 at 02:19:59PM -0500, Gianni Johansson wrote:
> On Tuesday 22 January 2002 11:51, Ian wrote:
> 
> > > It seems that there are now a number of modules designed to offer
> > diagnostic and useful internal information to the end user via a servlet.
> > I propose that we bring these all under one flexible mechanism.
> Tavin has done almost all of the work you would need to do this already with 
> his MultipleHttpServletContainer.java.
> 
> The piece that's missing is a way to enumerate relevant data (Human readable 
> text for servlet name, URL ) for other servlet's in the MHSC, perferrably in 
> the same order they were defined in the config file.
> 
> If the MHSC made this data available through the Servlet attribute mechanism, 
> then it would be trivial to write an index servlet which listed all the 
> servlets available on the port and gave links to them.  The index servlet 
> would then just be one more servlet in the MHSC.  This solution would be 
> generic -- it could work for any kind of servlets you want to aggregate on a 
> port, not just ones written to report status.

I suggesting having the HttpServletContainer add the attribute
"freenet.interfaces.servlet.HttpServletContainer" with a reference to
itself in HttpServletContainer.createServletContext().  You might
override the method in Single/MultipleHttpServletContainer and add
"freenet.interfaces.servlet.Single/MultipleHttpServletContainer" also.

Then add whatever expository methods are needed to
MultipleHttpServletContainer to get the data for generating the index.
Basically you just want to descend through the ContextData and
ServletData objects to figure out the URIs and get the ServletPool
object.  Add a getServletConfig() to ServletPool and you can then get
both the ServletContext and ServletConfig which has everything you need
including the servlet's name.

-tc


_______________________________________________
Devl mailing list
Devl at freenetproject.org
http://lists.freenetproject.org/mailman/listinfo/devl

Reply via email to