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/

Reply via email to