Return-Path: X-Original-To: apmail-cocoon-dev-archive@www.apache.org Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A1F75CE55 for ; Tue, 23 Jul 2013 12:31:19 +0000 (UTC) Received: (qmail 1162 invoked by uid 500); 23 Jul 2013 12:31:19 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 914 invoked by uid 500); 23 Jul 2013 12:31:18 -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 286 invoked by uid 99); 23 Jul 2013 12:31:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jul 2013 12:31:17 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of scherler@gmail.com designates 209.85.214.41 as permitted sender) Received: from [209.85.214.41] (HELO mail-bk0-f41.google.com) (209.85.214.41) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jul 2013 12:31:10 +0000 Received: by mail-bk0-f41.google.com with SMTP id jc3so2994276bkc.14 for ; Tue, 23 Jul 2013 05:30:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=zqMSNxHlptlvVb3mjBjb0Su46i4ATl+FzuW+qIjN2j8=; b=ovDOS2hCVCVTwSYuPmo6zmg3QBsMC6E7G5CIWYFSOB/9RNld2sDK59Wz7rJquCO0Lm qid/wWytSF9agNrZ04qt/RKrBa2xOtBT0uXyBRWsyozMVnZ41Zl4/FAWJDirrwgsZmJA HhWf3mrnNmF/NO1lgW20UIs7uyKx79UQgSOWlF9Sl/2fTt7stZ4iF/Vfzg7G5x31P9iw SoJo/nK0yqkYdtWJYmN52Ub6OE0xU4rXgl++5Oyo4TZ6jKu+YqFz+VMA625VKsBYB8sF h+e3xcJhPzHVBTvaw5iMDNqZnWVi5dAmI9Xc8T4CnDdPYy7AHS3dgDA8qo3158vrW7Pt co6w== X-Received: by 10.204.225.140 with SMTP id is12mr4558793bkb.142.1374582649894; Tue, 23 Jul 2013 05:30:49 -0700 (PDT) Received: from [10.0.0.17] (94.168.216.87.static.jazztel.es. [87.216.168.94]) by mx.google.com with ESMTPSA id kz11sm8209621bkb.11.2013.07.23.05.30.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Jul 2013 05:30:48 -0700 (PDT) Message-ID: <51EE7777.6020908@gmail.com> Date: Tue, 23 Jul 2013 14:30:47 +0200 From: Thorsten Scherler User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: [jira] [Closed] (COCOON3-129) Create an example to send a mail via cocoon References: <51ECCE84.40603@yahoo.de> <51ECE7D3.3060104@gmail.com> <51ED06D0.8010206@yahoo.de> <51ED3D50.5000008@gmail.com> <51EE61F2.9090807@yahoo.de> In-Reply-To: <51EE61F2.9090807@yahoo.de> Content-Type: multipart/alternative; boundary="------------040905050808070802030402" X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. --------------040905050808070802030402 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 07/23/2013 12:58 PM, Piratenvisier wrote: > ... >>> >>> I get the error: >>> >>> java.net.MalformedURLException: unknown protocol: servlet at >>> java.net.URL.(URL.java:592) at >>> java.net.URL.(URL.java:482) at >>> java.net.URL.(URL.java:431) at >>> org.apache.cocoon.rest.controller.response.URLResponse.(URLResponse.java:49) >>> at >>> org.apache.cocoon.sample.controller.DemoRESTController.doGet(DemoRESTController.java:54) >>> >>> >> >> Not sure but seems that he cannot resolve: return new >> URLResponse("servlet:/controller/screen", data); > When I went back to the original distribution without any changes and > even when I try new URL(new URL("servlet:"),"servlet:/controller/screen") > I get the same error,although I think that I once had success with the > distribution. Hmm not sure, I just tried the samples and they work fine for me. cd ~/src/apache/c3/cocoon-sample svn up At revision 1506007. mvn clean install jetty:run http://localhost:8888/jax-rs/sample/parameter-passing/5?req-param=7 works fine. > But I see a strong tendenca to a programmed pipeline and I found > myself even without cocoon on this way. see the pipeline example you can use cocoon-pipeline in you normal spring webapp (without cocoon servlet). >> >> However that seems pretty much as the sample block. >> Try just to start cocoon-rest-optional and do mvn clean install jetty:run >> >> I just added a small sample (I consider it quite clean) to use a >> pipeline in your java code. > How should i call the Restcontroller from the browser and what result > should I see ? cd ../cocoon-rest-optional #assuming you were in samples before mvn clean install jetty:run http://localhost:8888/ There are three different showcases, the last two ones are mail samples. Where "Here comes the response from server..." stands we will wait the response. I implement the whole thing with html5 and a bit of javascript to post to the server and update the response div with the server response. In case you have success it will read: "Result: true" while the request is processed you see "Processing request...". In case of result: false check the logs in ./target/work/cocoon.log salu2 -- Thorsten Scherler codeBusters S.L. - web based systems http://www.codebusters.es/ --------------040905050808070802030402 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
On 07/23/2013 12:58 PM, Piratenvisier wrote:
...

I get the error:

java.net.MalformedURLException: unknown protocol: servlet at java.net.URL.<init>(URL.java:592) at java.net.URL.<init>(URL.java:482) at java.net.URL.<init>(URL.java:431) at org.apache.cocoon.rest.controller.response.URLResponse.<init>(URLResponse.java:49) at org.apache.cocoon.sample.controller.DemoRESTController.doGet(DemoRESTController.java:54)


Not sure but seems that he cannot resolve: return new URLResponse("servlet:/controller/screen", data);
When I went back to the original distribution without any changes and even when I try new URL(new URL("servlet:"),"servlet:/controller/screen")
I get the same error,although I think that I once had success with the distribution.

Hmm not sure, I just tried the samples and they work fine for me.
cd ~/src/apache/c3/cocoon-sample
svn up
At revision 1506007.
mvn clean install jetty:run
http://localhost:8888/jax-rs/sample/parameter-passing/5?req-param=7 works fine.

But I see a strong tendenca to a programmed pipeline and I found myself even without cocoon on this way.

see the pipeline example you can use cocoon-pipeline in you normal spring webapp (without cocoon servlet).


However that seems pretty much as the sample block.
Try just to start cocoon-rest-optional and do mvn clean install jetty:run

I just added a small sample (I consider it quite clean) to use a pipeline in your java code.
How should i call the Restcontroller from the browser and what result should I see ?

cd ../cocoon-rest-optional #assuming you were in samples before
mvn clean install jetty:run
http://localhost:8888/

There are three different showcases, the last two ones are mail samples. Where "Here comes the response from server..." stands we will wait the response. I implement the whole thing with html5 and a bit of javascript to post to the server and update the response div with the server response. In case you have success it will read: "Result: true" while the request is processed you see "Processing request...". In case of result: false check the logs in ./target/work/cocoon.log

salu2
-- 
Thorsten Scherler <scherler.at.gmail.com>
codeBusters S.L. - web based systems
<consulting, training and solutions>

http://www.codebusters.es/
--------------040905050808070802030402--