Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 73778 invoked from network); 3 Apr 2007 04:30:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Apr 2007 04:30:33 -0000 Received: (qmail 15885 invoked by uid 500); 3 Apr 2007 04:30:39 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 15825 invoked by uid 500); 3 Apr 2007 04:30:39 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 15814 invoked by uid 99); 3 Apr 2007 04:30:39 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Apr 2007 21:30:39 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of riceyeh@gmail.com designates 66.249.92.174 as permitted sender) Received: from [66.249.92.174] (HELO ug-out-1314.google.com) (66.249.92.174) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Apr 2007 21:30:30 -0700 Received: by ug-out-1314.google.com with SMTP id m3so141971ugc for ; Mon, 02 Apr 2007 21:30:08 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=SJ8jcisQV3wrC/MyMrv9mvlL20HYhSgvY0cyaqcFNmY2w4sbtN0c4M6yKOqwNOx6cpVh91svK8Q4/tLVDyUCsK8ZsfqShdpkKoP9BBJxZ8I3ZGauTqEeOuUNm74lLOI57Rpmw4h/WsPPqTMYzJ0RXLxcfXN4DrgLGSRFnl5MLvM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=jB0wrUwcawBCPDCGQW9Fr2xiEn5VJ0hytJV6BH1SinA8vbtmv3hfepExzvRXnFpfSTaf0gxFb2bbiOPp43DATRv0iahSsoTpCeS44S0TdUmEwPYuyPPZk0y7qF7AVACvqza7c4TCDe7ltpZMSfsW5QaYdlGapuGJ/lNSpLxi/Q8= Received: by 10.78.183.15 with SMTP id g15mr1589437huf.1175574607324; Mon, 02 Apr 2007 21:30:07 -0700 (PDT) Received: by 10.78.83.10 with HTTP; Mon, 2 Apr 2007 21:30:07 -0700 (PDT) Message-ID: <47f71d940704022130s68872715o4ffaf28f66450efa@mail.gmail.com> Date: Tue, 3 Apr 2007 12:30:07 +0800 From: "Rice Yeh" To: dev@cocoon.apache.org Subject: Re: Parameters in request get lost when using servlet: protocol In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_830_16393820.1175574607283" References: <47f71d940704012335ic080521s177e9a03d8b512e1@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_830_16393820.1175574607283 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Thank you for your solution. But I still feel weird for a brand new request being created for a called block (servlet), at least for a super block (servlet). Having a look at the source code, each new brand request and response are supposed to be stored in its call frame (actually, this feature is not implemented yet, but api for retrieving these two objects are provided). If such design is intended, why not just treat request and response as part of servlet (block) context. And a way for passing a request's attributes or parameters must be provided. My real opinion is that request should be pass through all servlets invoked, instead of creating a new one. Rice On 4/2/07, Alexander Klimetschek wrote: > > We had the same problem already with the previous block: protocol. > Currently > the only way to send parameters to the other servlet via the URL. Thus I > have written a simple input module that converts your params into URL > params: > > - ParamsToURIModule: (Input Module) > > a meta module that converts all attributes of another module into a > correct > uri query string (&a=b;c=d) > > > http://www.mindquarry.org/repos/mindquarry-webapp/trunk/mindquarry-webapp-resources/src/main/java/com/mindquarry/webapp/modules/ParamsToURIModule.java > > > To use it, simply write this (if the input module is registered under > 'params-as-uri': > > > > > It is a meta input module, ie. it takes the name of another module and > converts all it's attributes into an URL query string. In this case it > will > add all request parameters. > > Alex > > > Rice Yeh schrieb: > > Hi, > > I find that all the parameters in a http request get lost when using > > servlet: in a sitemap like the following: > > > > > > > > Any clue? > > > > Rice > > > > > -- > Alexander Klimetschek > http://www.mindquarry.com > > ------=_Part_830_16393820.1175574607283 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thank you for your solution. But I still feel weird for a brand new request being created for a called block (servlet), at least for a super block (servlet). Having a look at the source code, each new brand request and response are supposed to be stored in its call frame (actually, this feature is not implemented yet, but api for retrieving these two objects are provided). If such design is intended, why not just treat request and response as part of servlet (block) context. And a way for passing a request's attributes or parameters must be provided. My real opinion is that request should be pass through all servlets invoked, instead of creating a new one.

Rice

On 4/2/07, Alexander Klimetschek <alexander.klimetschek@mindquarry.com> wrote:
We had the same problem already with the previous block: protocol. Currently
the only way to send parameters to the other servlet via the URL. Thus I
have written a simple input module that converts your params into URL params:

- ParamsToURIModule: (Input Module)

a meta module that converts all attributes of another module into a correct
uri query string (&a=b;c=d)

http://www.mindquarry.org/repos/mindquarry-webapp/trunk/mindquarry-webapp-resources/src/main/java/com/mindquarry/webapp/modules/ParamsToURIModule.java


To use it, simply write this (if the input module is registered under
'params-as-uri':

<map:read src="servlet:super:/{0}?{params-as-uri:request-param}"/>


It is a meta input module, ie. it takes the name of another module and
converts all it's attributes into an URL query string. In this case it will
add all request parameters.

Alex


Rice Yeh schrieb:
> Hi,
>  I find that all the parameters in a http request get lost when using
> servlet: in a sitemap like the following:
>
> <map:read src="servlet:super:/{0}"/>
>
> Any clue?
>
> Rice
>


--
Alexander Klimetschek
http://www.mindquarry.com


------=_Part_830_16393820.1175574607283--