[SOLVED (+ or -)] JET context.getVariable returning AnyTypeImpl [message #831929] |
Thu, 29 March 2012 10:31  |
daniel conrado Messages: 2 Registered: August 2011 |
Junior Member |
|
|
In my template, I have this:
<%@jet imports="mymodel.*"%>
...
<c:iterate select="/Robot/sensors" var="sensor">
<%
Sensor s = (Sensor) context.getVariable("sensor");
...
%>
But I'm getting this error:
java.lang.ClassCastException: org.eclipse.emf.ecore.xml.type.impl.AnyTypeImpl cannot be cast to mymodel.Sensor
I don't understand. What am I doing wrong?
Best Regards,
Daniel
[Updated on: Sat, 31 March 2012 10:03] Report message to a moderator
|
|
|
| Re: JET context.getVariable returning AnyTypeImpl [message #833450 is a reply to message #831929] |
Sat, 31 March 2012 10:03  |
daniel conrado Messages: 2 Registered: August 2011 |
Junior Member |
|
|
I still can't figure out how to access the Sensor object, but I've got a workaround for my problem. Here it is:
Instead of accessing the object, I write the values I want into variables, like this:
<c:setVariable var="sensorName" select="string($sensor/@name)"/>
And access this way:
final String sensorName = (String) context.getVariable("sensorName");
Hope it may be useful.
Thanks for reading.
Cheers,
Daniel
|
|
|
Powered by
FUDForum. Page generated in 0.01648 seconds