myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Nowak <now...@gmail.com>
Subject t:updateActionListener - JspValueExpression.toString() as a value of property instead of a literal value
Date Thu, 20 Jun 2013 12:26:21 GMT
Hi everyone,

I'm having strange problem after upgrading myfaces from version 1.1.6 to
1.2.12 and tomahawk to version tomahawk12-1.1.14.
I have also upgraded tomcat to version 7.0.27 (i'm not sure if it is
relevant).
Here is some jsp view where updateActionListener is being used:

<h:commandLink value="#{bundle.menu_general}">
<t:updateActionListener property="#{MyBean.currentTab}" value="general"/> 
</h:commandLink>

The currentTab method is a setter for property of type String.
In previous configuration above code worked fine, it means that after the
"general" link had been pressed the value of currentTab property in the
MyBean has been set to "general".

In current configuration I saw that instead of "general" string as a value
of property i had string representation of object of type
JspValueExpression, something like
org.apache.jasper.el.JspValueExpression@bac048fd. 
After some investigation of the problem i noticed that
org.apache.el.parser.AstValue.setValue(EvaluationContext, Object) method is
responsible for that:
http://grepcode.com/file/repo1.maven.org/maven2/org.apache.tomcat.embed/tomcat-embed-jasper/7.0.27/org/apache/el/parser/AstValue.java#AstValue.setValue%28org.apache.el.lang.EvaluationContext%2Cjava.lang.Object%29

In this method value is checked if it can be assigned to the type of the
setter argument, if not the result of toString method call is returned. This
is my case, the object is of type org.apache.jasper.el.JspValueExpression so
i got mentioned org.apache.jasper.el.JspValueExpression@bac048fd.
I'm going to try write a converter which will return the real value from
JspValueExpression but I'm not sure if it is good idea. 

I'm really stuck here.

Can anyone help me with this problem?

Regards,
Adam Nowak.



--
View this message in context: http://myfaces.10567.n7.nabble.com/t-updateActionListener-JspValueExpression-toString-as-a-value-of-property-instead-of-a-literal-value-tp115114.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Mime
View raw message