Mark Lundquist skrev:On Jan 2, 2007, at 2:36 PM, Daniel Fagerstrom wrote:I would prefer servlet-services-fw or just servlet-services. • ServiceServlet (or "CocoonServiceServlet"?)ServletService would be OK. • ServiceContext (or "CocoonServiceContext"?)ServiceServletContext maybe. • "service:" protocolTo generic in my taste. I think that "servlet:" protocol would describe pretty well what it all is about. Also it is implemented using the named dispatcher mechanism in the ServletContext, so it really is named servlets that the protocol dispatches to. Also we could add some Spring bean factory and XML-schema based configuration, that put the focus on the embedded servlet instead of the "blocks fw" so instead of: <bean id="org.apache.cocoon.blocks.sample.block1" class="org.apache.cocoon.blocks.BlockServlet">
<property name="mountPath" value="/cocoon-blocks-fw-sample1"/>
<property name="servletClass" value="org.apache.cocoon.sitemap.SitemapServlet"/>
<property name="blockContextURL" value="blockcontext:/cocoon-blocks-fw-sample/test1"/>
<property name="properties">
<map>
<entry key="foo" value="bar"/>
</map>
</property>
<property name="connections">
<map>
<entry key="test2" value-ref="org.apache.cocoon.blocks.sample.block2"/>
</map>
</property>
</bean>
we could have something like: <bean id="org.apache.cocoon.blocks.sample.block1" class="org.apache.cocoon.sitemap.SitemapServlet">
<servlet:context mountPath="/cocoon-blocks-fw-sample1"
contextPath="blockcontext:/cocoon-blocks-fw-sample/test1">
<servlet:context-param name="foo" value="bar"/>
<servlet:connection name="test2" value-ref="org.apache.cocoon.blocks.sample.block2"/>
</servlet:context>
</bean>
The point here is that the sitemap servlet is considered as an ordinary
bean and the elements in the servlet name space sets up a bean factory
that embeds the sitemap servlet in a block servlet and make sure that
the somewhat special life cycle of servlets is respected. Using a
servlet in the Spring framework would be as easy as: <bean id="myservlet" class="com.mycompany.MyServlet">
<servlet:context mountPath="/my">
</bean>
And would be usable outside Cocoon.Another advantage of dropping the prefix "block" from the "polymorphic servlet service" stuff is that I get the impression that many people believe that anything that is prefixed with block is incredibly complicated. While the current stuff actually isn't. WDYT? /Daniel |
- Re: What is the deal with "blocks" Daniel Fagerstrom
- Re: What is the deal with "blocks" Alexander Klimetschek
- What is the deal with "pipelines"... Mark Lundquist
- Re: What is the deal with "pipelin... Vadim Gritsenko
- Re: What is the deal with "pip... Mark Lundquist
- Re: What is the deal with "blocks" Mark Lundquist
- Re: What is the deal with "blocks" Reinhard Poetz
- Re: What is the deal with "blocks"... Daniel Fagerstrom
- Re: What is the deal with "blocks" Daniel Fagerstrom
