Grzegorz Kossakowski skrev:
Daniel Fagerstrom pisze:
A Spring bean with directory info seem like a good idea. For
increasing the usability I would suggest to implement a new source as
well "servlets:" e.g. This source should be a listable source so that
you can use it with e.g. the directory generator. The source would of
course only be listable at the root level the listed sources would of
course be ordinary servlet: sources.
So would it be possible to access resources via servlets: source (by
using internally a servlet: source) or not?
I think that should be possible. URIs could look like:
servlets:/<bean id>/<internal path>
So in
http://svn.apache.org/repos/asf/cocoon/trunk/core/cocoon-webapp/src/main/webapp/blocks/sitemap.xmap
we could use:
<map:generate type="xpathtraversable" src="servlets:/">
instead of the current construction. I started to work on something
like that half a year ago but never finished it.
After having a list of servlets we would have to find out which one
contain samples. I guess that it's good idea to ask every servlet for
certain resource (e.g. samples.xsamples file).
Yes.
But how we do this not
being connected to all these servlets?
As Giacomo suggested it could be done by making the list from
o.a.c.servletservice.DispatcherServlet#createMountableServletsMap
available in a Spring bean. Another possibility would be to let the
blocks source depend on a bean map
http://svn.apache.org/repos/asf/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/BeanMap.java
that collects all beans that implement Servlet.
/Daniel