You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Antonio Gallardo <ag...@agsoftware.dnsalias.com> on 2004/01/04 10:26:44 UTC

[Cform] binding sample broken

Hi:

This sample:
http://localhost:8080/cocoon/samples/woody/form2bean.flow

currently is not working, throw an error page.

Best Regards,

Antonio Gallardo

Original Exception: java.lang.RuntimeException: Incorrect value type for
"number" (expected class java.lang.Long, got class java.lang.Integer.
	at org.apache.cocoon.woody.formmodel.Field.setValue(Field.java:171)
	at
org.apache.cocoon.woody.binding.ValueJXPathBinding.doLoad(ValueJXPathBinding.java:127)
	at
org.apache.cocoon.woody.binding.JXPathBindingBase.loadFormFromModel(JXPathBindingBase.java:159)
	at
org.apache.cocoon.woody.binding.ComposedJXPathBindingBase.doLoad(ComposedJXPathBindingBase.java:129)
	at
org.apache.cocoon.woody.binding.ContextJXPathBinding.doLoad(ContextJXPathBinding.java:85)
	at
org.apache.cocoon.woody.binding.JXPathBindingBase.loadFormFromModel(JXPathBindingBase.java:159)
	at
org.apache.cocoon.woody.binding.JXPathBindingBase.loadFormFromModel(JXPathBindingBase.java:175)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:230)
	at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)


Re: Proxy generator or file generator to retreive web pages?

Posted by Vadim Gritsenko <va...@verizon.net>.
Davide wrote:

> Hi!...
>
> i have a pipeline where i retreive a web page dinamically, and then 
> i'll need to edit it:
>
>
>             <map:match pattern="body">
>                 <map:act type="auth-protect">
>                     <map:parameter name="handler" value="navigation"/>
>                     <map:parameter name="use-request-parameters" 
> value="true"/>
>                     <!-- generator... both wsproxy and normal file 
> generator are possible -->
>                     <map:generate src="{request-param:link}"/> 
> <!--type="proxy" label="xml"-->
>                     ...
>                     ...
>                 </map:act>
>             </map:match>
>
> I observed that i can use both normal file generator and proxy 
> generator, with apparently no difference, both returns to me the 
> requested xhtml page;
> So, I would like to know if there are important differences, and when 
> to use file gen and when proxy gen


If you mean HttpProxyGenerator, the only difference is that proxy can 
support POST, accepts parameters as map:parameters, uses HttpClient 
library, can support redirects. See source code for details.

Vadim



Proxy generator or file generator to retreive web pages?

Posted by Davide <da...@aliceposta.it>.
Hi!...

i have a pipeline where i retreive a web page dinamically, and then i'll 
need to edit it:


			<map:match pattern="body">
				<map:act type="auth-protect">
					<map:parameter name="handler" value="navigation"/>
					<map:parameter name="use-request-parameters" value="true"/>
					<!-- generator... both wsproxy and normal file generator are possible -->
					<map:generate src="{request-param:link}"/> <!--type="proxy" label="xml"-->
					...
					...
				</map:act>
			</map:match>

I observed that i can use both normal file generator and proxy generator, 
with apparently no difference, both returns to me the requested xhtml page;
So, I would like to know if there are important differences, and when to 
use file gen and when proxy gen

Best Regards, Davide



Re: [Cform] binding sample broken

Posted by Marc Portier <mp...@outerthought.org>.
Well,

this seems like one _positive_ effect of me lining up the 'lenient' 
stuff :-)

the catch-all stratetgy over at ValueJXPathBinding has been hiding that 
this wasn't working from the start!

I just changed the form2-model.xml to be declaring number as of type 
'integer' to match the bean, which fixes the sample. (I could of have 
changed the type over in the bean as well of course)

regards,
-marc=
(for those wondering: during binding back the setValue() of type long on 
a bean-property of type int is (leniently) handled by jxpath, the other 
way around woody requires a full match though)

Antonio Gallardo wrote:

> Hi:
> 
> This sample:
> http://localhost:8080/cocoon/samples/woody/form2bean.flow
> 
> currently is not working, throw an error page.
> 
> Best Regards,
> 
> Antonio Gallardo
> 
> Original Exception: java.lang.RuntimeException: Incorrect value type for
> "number" (expected class java.lang.Long, got class java.lang.Integer.
> 	at org.apache.cocoon.woody.formmodel.Field.setValue(Field.java:171)
> 	at
> org.apache.cocoon.woody.binding.ValueJXPathBinding.doLoad(ValueJXPathBinding.java:127)
> 	at
> org.apache.cocoon.woody.binding.JXPathBindingBase.loadFormFromModel(JXPathBindingBase.java:159)
> 	at
> org.apache.cocoon.woody.binding.ComposedJXPathBindingBase.doLoad(ComposedJXPathBindingBase.java:129)
> 	at
> org.apache.cocoon.woody.binding.ContextJXPathBinding.doLoad(ContextJXPathBinding.java:85)
> 	at
> org.apache.cocoon.woody.binding.JXPathBindingBase.loadFormFromModel(JXPathBindingBase.java:159)
> 	at
> org.apache.cocoon.woody.binding.JXPathBindingBase.loadFormFromModel(JXPathBindingBase.java:175)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:324)
> 	at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:230)
> 	at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)
> 

-- 
Marc Portier                            http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at                http://blogs.cocoondev.org/mpo/
mpo@outerthought.org                              mpo@apache.org