Joerg Heinicke pisze:
On 02.07.2007 20:19, Andrew Stevens wrote:
And then inspiration hit - why not instead create a new input Source
for JSPs?
And then I started to over-think it :-) Why only JSPs? Why not
servlets too? How does this differ from the context: source type?
Surely someone must have thought of doing this before - is there no
similar facility already? What about in Cocoon 2.2 - would the
servlet/blocks framework that keeps getting discussed cater for this
anyway? At which point I figured the best thing to do was to dump my
thoughts to the list and see if anyone had any feedback or
suggestions...
Hi Andrew,
your ideas sound absolutely reasonable. I appreciate every improvement
to the integration of JSP or servlets in general though I don't use it
myself (yet). In 2.1 I would really opt for a new source. I only wonder
if this is necessary at all in 2.2. I got the impression (just from
mailing list) it should be quite easy to integrate Cocoon with other
servlets but somebody with actual knowledge might add more details here.
What I for example would really like to have is a CocoonView for
Spring's ViewRendererServlet or use Cocoon as replacement for the
ViewRendererServlet.
Yep, you are right Joerg and Andrew, servlet-service-fw is the way to go.
Basically, you need to register JSP servlet as Spring bean, then you can connect to it from other servlet (Cocoon block) using its bean's Id
and use servlet:/ source for this. Take a look at:
[1] for servlet configuration as spring bean
[2] for demo servlet itself
All needed functionality is already there and working, it's a matter of providing sample and (really preferably) some documentation how to
utilize servlet-service-fw functionality to integrate with JSP.
[1]
http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-sample/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-demo1-servletService.xml?view=markup
[2]
http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-sample/src/main/java/org/apache/cocoon/servletservice/demo1/DemoServlet.java?view=markup
--
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/