JXTemplate often fail a method call without giving any error
------------------------------------------------------------
Key: COCOON-1978
URL: https://issues.apache.org/jira/browse/COCOON-1978
Project: Cocoon
Issue Type: Bug
Components: Blocks: Templating
Affects Versions: 2.2-dev (Current SVN)
Reporter: Simone Gianni
When calling a method on an instance in JXTemplate, if that method does not
exist (or JX cannot find the proper method based on parameters), it fails
without any error. IMO it should raise an error, or at least should raise it in
dev mode, because not having a debugger it takes hours to figure out why it's
not working.
As an example, take a JX and try to call a method that does not exist :
<jx:set var="any" value="${obj.getSomethingThatDoesNotExist(cocoon.request)}"/>
Any will simply be null. Moreover, even if "any" is then used :
${any.getSomethingElse()}
Again it will fail without any error, resulting simply in an empty string,
making it even harder.
Being a non compiled language already makes it difficult to make sure calls are
correct, having this "silent fail" behavior makes it even harder, and if you
add also the non typized nature it can make it a nightmare.
Anyway, I don't know if there is a way to fix this in cocoon or if it is a Jexl
design problem.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira