[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xml-cocoon-dev
Subject:    [jira] Commented: (COCOON-1725) Unexpected attempt to read values of JavaBean while saving form
From:       "Mark Lundquist (JIRA)" <jira () apache ! org>
Date:       2005-12-27 0:02:32
Message-ID: 29152219.1135641752296.JavaMail.jira () ajax ! apache ! org
[Download RAW message or body]

    [ http://issues.apache.org/jira/browse/COCOON-1725?page=comments#action_12361248 \
] 

Mark Lundquist commented on COCOON-1725:
----------------------------------------

> Just for sure, do you speak about the execution of child element fb:on-update? 

Not particularly; I mean just saving the value itself if it has changed.

> Despite the purpose, I think lack of the get method should mean that there is no \
> way to check whether a model update is > required. 

Maybe so... like I said, I'm not sure I know enough to really say.  Someone more \
expert than me will have to give an opinion.

> So maybe lenient mode[1] will 
> help us? Then it would look like: 
> jxpc.setLenient(true); 
> Object oldValue = jxpc.getValue(this.xpath); 
> jxpc.setLenient(false); 

I don't think so... first off, JXPath leniency is already a configurable feature of \
the binding framework, i.e. lenient may already be set to true before you even get to \
it.  In fact, IIRC, it is, because we default it to true (and this was the source of \
a hard-to-debug problem for me a while back! :-/).That's no showstopper of course, \
you'd just restore the original leniency setting instead of always setting it to \
false.  But more importantly, in lenient mode, getValue() on a non-existent jxpath \
returns null, and I think that is not what we want here...

Also, it looks like ValueJXPathBinding currently has no way to access the direction, \
i.e. doSave() has been called because @direction was "save" or "both", but it has no \
way to distinguish between a the two cases.



> Unexpected attempt to read values of JavaBean while saving form
> ---------------------------------------------------------------
> 
> Key: COCOON-1725
> URL: http://issues.apache.org/jira/browse/COCOON-1725
> Project: Cocoon
> Type: Bug
> Components: Blocks: Forms
> Versions: 2.1.8
> Reporter: Grzegorz Kossakowski (aka g[R]eK)
> Priority: Minor

> 
> Problem lays in org.apache.cocoon.forms.binding.ValueJXPathBinding.doSave at line \
> 123: Object oldValue = jxpc.getValue(this.xpath); //line 123
> if (getLogger().isDebugEnabled()) {
> getLogger().debug("value= " + value + "-- oldvalue=" + oldValue);
> }
> This is for debugging purpose and it's quite handy but if there is no get method in \
> bean exception org.apache.commons.jxpath.JXPathException: No read method will be \
> thrown and binding will be interrupted. It will try to read value even \
> @direction="save" is set. I think it is not valid to require read method while it \
> is excplicitly stressed the direction of binding.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic