cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Robson <glen.rob...@llgc.org.uk>
Subject Re: Deploying Cocoon 2.2 to tomcat
Date Fri, 06 Nov 2009 15:12:42 GMT
Hi Dom,

> I think that this is the wrong way of attaching a servlet to a  
> block.  If you have a look in META-INF/cocoon/spring/block-servlet- 
> service.xml, you need to define a bean for your servlet.  Then you  
> can get get rid of the xweb patching stuff, and cocoon's servlet  
> service framework dispatcher will take care of invoking your servlet  
> for you.
>
> I would guess that your bean should look like something like this:
>
> <bean name="uk.org.llgc.offair.maintance.servlet.service"  
> class="uk.org.llgc.offair.maintance.servlet.UploadXML">
>   <servlet:context mount-path="/offair_maintance/upload" context- 
> path="blockcontext:/offair_maintance/" />
>   <servlet:init-params>
>     <entry key="UploadXML" value="/usr/local/offair/maintenance"/>
>   </servlet:init-params>
> </bean>

I moved the servlet to the block-servlet-service and it works great :D  
on jetty and tomcat.

> Given the non-documentation of the SSF, you may have a hard time  
> figuring out what the correct values should be without looking at  
> the source code. :(
>
> http://svn.apache.org/repos/asf/cocoon/trunk/subprojects/cocoon-servlet-service/

Thanks for the link I've really struggled to find any information on  
the Servlet integration so Ill have a look in there to see whats going  
on.

>
> You may also wish to look at the upload sample in order to see how  
> to write your own upload code using FlowScript, avoiding the need  
> for a servlet entirely.
>
> http://svn.apache.org/repos/asf/cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-main-sample/src/main/resources/COB-INF/sources/
>
> (look for upload://)
>
> Hopefully somebody with more cocoon experience than myself will jump  
> in here…
>
> … snip …
>
> Thanks for your help and I hope the above explanation makes sense.
>
> It does.  But I think you're making life hard for yourself by not  
> doing things in "the cocoon way".

Is writing code using Java Servlets and the SSF less the "cocoon way"  
than using flowscript or were you referring to the xweb use?

I'm afraid I'm new to cocoon 2.2 but have used cocoon 2.1.1 for the  
last few years.

Thanks for fixing the issue.

Glen


Mime
View raw message