You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Anders Högqvist <ho...@hotmail.com> on 2001/04/17 17:09:53 UTC

urgent fp taglib problems

Greetings!

I have tried to make a site with a form using fp taglib, but cocoon doesn't do anything with it. I have followed the example that was enclosed with cocoon but I have probably missed something.

In my xml file I have the following lines right after <page>:

<fp:resource id="target">
    <fp:resource-file>vader.xml</fp:resource-file>
    <fp:resource-node>page/vader</fp:resource-node>
</fp:resource>

and my form looks like this:

<form action="vader.xml" method="GET">
    <input type="select">
        <name>stad</name>
        <option>blabla</option>
        <fp:if-get>
            <fp:write select="vader" to="target">
            blabla
            </fp:write>
        </fp:if-get>
    </input>
    <input type="submit" value="Hämta väder"/>
</form>

In the generated html code the following lines are written:

<fp:resource id="target" xmlns:fp="http://apache.org/cocoon/XSP/FP/1.0">
    <fp:resource-file>vader.xml</fp:resource-file>
    <fp:resource-node>page/vader</fp:resource-node>
</fp:resource>

and vader.xml and page/vader is shown in the browser. When I press the submit button nothing happends. I have checked that fp is correctly configured in cocoon.properties.

Please help me on this one!

/Anders Högqvist

Re: urgent fp taglib problems

Posted by simone cecchini <si...@kiosco.org>.
dear anders,
which examples are you referring to? the examples that come with the 1.8.2 dist doesn't do that the way you do, neither the ones that came with a couple-of-weeks-ago cvs dist.
in those examples, the file index.xml is being edited through the forms in the 'form' dir.
are you sure you have put the correct prolog

<?cocoon-process type="xsp"?>
<xsp:page xmlns:fp="http://apache.org/cocoon/XSP/FP/1.0"
language="java">

bye,
simone

At 10:32 4/18/01 +0200, you wrote:
>But they are doing it in the example enclosed with cocoon. There they read
>from a default document and write to the same document as the form. Since
>cocoon totaly ignore the fp tags there must be something else I've missed.
>
>/Anders
>
>
>----- Original Message -----
>From: "simone cecchini" <si...@kiosco.org>
>To: <co...@xml.apache.org>
>Sent: Tuesday, April 17, 2001 5:59 PM
>Subject: Re: urgent fp taglib problems
>
>
>i think you can't do this. you are trying to write the same file you are
>using as form handler. this might have caused some strange problems with xsp
>code generation.
>you should get sure you have
>
><?cocoon-process type="xsp"?>
><xsp:page xmlns:fp="http://apache.org/cocoon/XSP/FP/1.0"
>language="java">
>in your prolog
>
>>Greetings!
>>
>>I have tried to make a site with a form using fp taglib, but cocoon doesn't
>do anything with it. I have followed the example that was enclosed with
>cocoon but I have probably missed something.
>>
>>In my xml file I have the following lines right after <page>:
>>
>><fp:resource id="target">
>>    <fp:resource-file>vader.xml</fp:resource-file>
>>    <fp:resource-node>page/vader</fp:resource-node>
>></fp:resource>
>>
>
>you should have put <fp:resource-node>/page/vader</fp:resource-node>,
>provided that 'page' is your document element
>
>>and my form looks like this:
>>
>><form action="vader.xml" method="GET">
>>    <input type="select">
>>        <name>stad</name>
>>        <option>blabla</option>
>>        <fp:if-get>
>>            <fp:write select="vader" to="target">
>>            blabla
>>            </fp:write>
>>        </fp:if-get>
>
>in this way, the writing happens every time you perform a get operation
>(<fp:if-get...), even when you load the page for the first time. moreover,
>if you want to write your data as the content of the 'page/vader' element,
>you should simply put select="." (the selected node is already page/vader).
>if you want your page look different when 'got' or posted, you can simply
>put
><fp:if-get>
><normal tag for get case>
></fp:if-get>
>
><fp:if-post>
><normal tag for post case>
></fp:if-post>
>
>>    </input>
>>    <input type="submit" value="Hämta väder"/>
>></form>
>>
>>In the generated html code the following lines are written:
>
>it seems that the taglib doesn't get executed. pay attention to the prolog.
>hth,
>simone
>
>><fp:resource id="target" xmlns:fp="http://apache.org/cocoon/XSP/FP/1.0">
>>    <fp:resource-file>vader.xml</fp:resource-file>
>>    <fp:resource-node>page/vader</fp:resource-node>
>></fp:resource>
>>
>>and vader.xml and page/vader is shown in the browser. When I press the
>submit button nothing happends. I have checked that fp is correctly
>configured in cocoon.properties.
>>
>>Please help me on this one!
>>
>>/Anders Högqvist
>>
>
>---------------------------------------------------------------------
>Please check that your question has not already been answered in the
>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
>To unsubscribe, e-mail: <co...@xml.apache.org>
>For additional commands, e-mail: <co...@xml.apache.org>
>
>
>
>---------------------------------------------------------------------
>Please check that your question has not already been answered in the
>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
>To unsubscribe, e-mail: <co...@xml.apache.org>
>For additional commands, e-mail: <co...@xml.apache.org>
>
>

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: urgent fp taglib problems

Posted by Anders Högqvist <ho...@hotmail.com>.
But they are doing it in the example enclosed with cocoon. There they read
from a default document and write to the same document as the form. Since
cocoon totaly ignore the fp tags there must be something else I've missed.

/Anders


----- Original Message -----
From: "simone cecchini" <si...@kiosco.org>
To: <co...@xml.apache.org>
Sent: Tuesday, April 17, 2001 5:59 PM
Subject: Re: urgent fp taglib problems


i think you can't do this. you are trying to write the same file you are
using as form handler. this might have caused some strange problems with xsp
code generation.
you should get sure you have

<?cocoon-process type="xsp"?>
<xsp:page xmlns:fp="http://apache.org/cocoon/XSP/FP/1.0"
language="java">
in your prolog

>Greetings!
>
>I have tried to make a site with a form using fp taglib, but cocoon doesn't
do anything with it. I have followed the example that was enclosed with
cocoon but I have probably missed something.
>
>In my xml file I have the following lines right after <page>:
>
><fp:resource id="target">
>    <fp:resource-file>vader.xml</fp:resource-file>
>    <fp:resource-node>page/vader</fp:resource-node>
></fp:resource>
>

you should have put <fp:resource-node>/page/vader</fp:resource-node>,
provided that 'page' is your document element

>and my form looks like this:
>
><form action="vader.xml" method="GET">
>    <input type="select">
>        <name>stad</name>
>        <option>blabla</option>
>        <fp:if-get>
>            <fp:write select="vader" to="target">
>            blabla
>            </fp:write>
>        </fp:if-get>

in this way, the writing happens every time you perform a get operation
(<fp:if-get...), even when you load the page for the first time. moreover,
if you want to write your data as the content of the 'page/vader' element,
you should simply put select="." (the selected node is already page/vader).
if you want your page look different when 'got' or posted, you can simply
put
<fp:if-get>
<normal tag for get case>
</fp:if-get>

<fp:if-post>
<normal tag for post case>
</fp:if-post>

>    </input>
>    <input type="submit" value="Hämta väder"/>
></form>
>
>In the generated html code the following lines are written:

it seems that the taglib doesn't get executed. pay attention to the prolog.
hth,
simone

><fp:resource id="target" xmlns:fp="http://apache.org/cocoon/XSP/FP/1.0">
>    <fp:resource-file>vader.xml</fp:resource-file>
>    <fp:resource-node>page/vader</fp:resource-node>
></fp:resource>
>
>and vader.xml and page/vader is shown in the browser. When I press the
submit button nothing happends. I have checked that fp is correctly
configured in cocoon.properties.
>
>Please help me on this one!
>
>/Anders Högqvist
>

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: urgent fp taglib problems

Posted by simone cecchini <si...@kiosco.org>.
i think you can't do this. you are trying to write the same file you are using as form handler. this might have caused some strange problems with xsp code generation.
you should get sure you have

<?cocoon-process type="xsp"?>
<xsp:page	xmlns:fp="http://apache.org/cocoon/XSP/FP/1.0"
		language="java">
in your prolog

>Greetings!
>  
>I have tried to make a site with a form using fp taglib, but cocoon doesn't do anything with it. I have followed the example that was enclosed with cocoon but I have probably missed something.
>  
>In my xml file I have the following lines right after <page>:
>  
><fp:resource id="target">
>    <fp:resource-file>vader.xml</fp:resource-file>
>    <fp:resource-node>page/vader</fp:resource-node>
></fp:resource>
>

you should have put <fp:resource-node>/page/vader</fp:resource-node>, provided that 'page' is your document element

>and my form looks like this:
>  
><form action="vader.xml" method="GET">
>    <input type="select">
>        <name>stad</name>
>        <option>blabla</option>
>        <fp:if-get>
>            <fp:write select="vader" to="target">
>            blabla
>            </fp:write>
>        </fp:if-get>

in this way, the writing happens every time you perform a get operation (<fp:if-get...), even when you load the page for the first time. moreover, if you want to write your data as the content of the 'page/vader' element, you should simply put select="." (the selected node is already page/vader).
if you want your page look different when 'got' or posted, you can simply put
<fp:if-get>
	<normal tag for get case>
</fp:if-get>

<fp:if-post>
	<normal tag for post case>
</fp:if-post>

>    </input>
>    <input type="submit" value="Hämta väder"/>
></form>
>  
>In the generated html code the following lines are written:

it seems that the taglib doesn't get executed. pay attention to the prolog.
hth,
simone

><fp:resource id="target" xmlns:fp="http://apache.org/cocoon/XSP/FP/1.0">
>    <fp:resource-file>vader.xml</fp:resource-file>
>    <fp:resource-node>page/vader</fp:resource-node>
></fp:resource>
>  
>and vader.xml and page/vader is shown in the browser. When I press the submit button nothing happends. I have checked that fp is correctly configured in cocoon.properties.
>  
>Please help me on this one!
>  
>/Anders Högqvist
>

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>