Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 38281 invoked from network); 6 Nov 2009 15:13:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 6 Nov 2009 15:13:09 -0000 Received: (qmail 27422 invoked by uid 500); 6 Nov 2009 15:13:08 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 27346 invoked by uid 500); 6 Nov 2009 15:13:08 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: users@cocoon.apache.org List-Id: Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 27338 invoked by uid 99); 6 Nov 2009 15:13:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Nov 2009 15:13:08 +0000 X-ASF-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE,RCVD_IN_DNSWL_MED X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [193.61.220.150] (HELO magi.llgc.org.uk) (193.61.220.150) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Nov 2009 15:13:06 +0000 Received: from [193.61.221.2] (helo=p035xp.llgc.org.uk) by magi.llgc.org.uk with esmtp (Exim 4.63) (envelope-from ) id 1N6QUU-0004Mx-IW for users@cocoon.apache.org; Fri, 06 Nov 2009 15:12:42 +0000 Message-Id: From: Glen Robson To: users@cocoon.apache.org In-Reply-To: <45c308810911060444i72068e32r9028fcd1fb18b46b@mail.gmail.com> Content-Type: multipart/alternative; boundary=Apple-Mail-6-40287946 Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Deploying Cocoon 2.2 to tomcat Date: Fri, 6 Nov 2009 15:12:42 +0000 References: <2D103E03-CB56-43CF-BC83-AC80541D8FF4@llgc.org.uk> <45c308810911041435y2fde5ed8nf3317eae4d05487c@mail.gmail.com> <69BD2DCC-89CC-45FE-AC96-717D524D5133@llgc.org.uk> <45c308810911050201r48d1e17aobabaf09b6c22b818@mail.gmail.com> <4B171916-8339-4248-85D7-AD18179E4E4B@llgc.org.uk> <45c308810911060440q715aac96m6378f5427dc2cf02@mail.gmail.com> <45c308810911060444i72068e32r9028fcd1fb18b46b@mail.gmail.com> X-Mailer: Apple Mail (2.936) --Apple-Mail-6-40287946 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Hi Dom, > I think that this is the wrong way of attaching a servlet to a =20 > block. If you have a look in META-INF/cocoon/spring/block-servlet-=20 > service.xml, you need to define a bean for your servlet. Then you =20 > can get get rid of the xweb patching stuff, and cocoon's servlet =20 > service framework dispatcher will take care of invoking your servlet =20= > for you. > > I would guess that your bean should look like something like this: > > class=3D"uk.org.llgc.offair.maintance.servlet.UploadXML"> > path=3D"blockcontext:/offair_maintance/" /> > > > > I moved the servlet to the block-servlet-service and it works great :D =20= on jetty and tomcat. > Given the non-documentation of the SSF, you may have a hard time =20 > figuring out what the correct values should be without looking at =20 > the source code. :( > > = http://svn.apache.org/repos/asf/cocoon/trunk/subprojects/cocoon-servlet-se= rvice/ Thanks for the link I've really struggled to find any information on =20 the Servlet integration so Ill have a look in there to see whats going =20= on. > > You may also wish to look at the upload sample in order to see how =20 > to write your own upload code using FlowScript, avoiding the need =20 > for a servlet entirely. > > = http://svn.apache.org/repos/asf/cocoon/trunk/blocks/cocoon-core-sample/coc= oon-core-main-sample/src/main/resources/COB-INF/sources/ > > (look for upload://) > > Hopefully somebody with more cocoon experience than myself will jump =20= > in here=85 > > =85 snip =85 > > 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 =20 > doing things in "the cocoon way". Is writing code using Java Servlets and the SSF less the "cocoon way" =20= 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 =20 last few years. Thanks for fixing the issue. Glen --Apple-Mail-6-40287946 Content-Type: text/html; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable 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=3D"uk.org.llgc.offair.maintance.servlet.service" = class=3D"uk.org.llgc.offair.maintance.servlet.UploadXML">
=   <servlet:context mount-path=3D"/offair_maintance/upload" = context-path=3D"blockcontext:/offair_maintance/" />
  <servlet:init-params>
    <entry key=3D"UploadXML" = value=3D"/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. :(


=
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.


(look for = upload://)

Hopefully somebody with more cocoon = experience than myself will jump in here=85

=85 snip = =85
 
=
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

= --Apple-Mail-6-40287946--