Since upgrading from WAS6.1 to WAS7.0 I’m getting an error when trying to display a value contained in an array.
Java:
private Date[] days = new Date[10];
public Date[] getDays() {
return days;
}
JSP:
<td><fmt:formatDate value="${fair.days[0]}" pattern="dd.MM.yyyy" /><td>
This causes the following error:
[Exception in:/tilesContent/listFairs_bodyarea.jsp] Missing Resource in EL
implementation: ???propertyNotReadable???
My application works fine when deployed to a WAS6.1 server. The problem only occurs on WAS7.
I added a getFirstDay() method which returns days[0] and accessed it using ${fair.firstDay} and this works. Is there a problem accessing arrays?
I think I have found an partial explanation and a work-around for the problem.
I added a new indexed property to the Fair class to check that indexed
properties work ok. They do.
I added a new getter for the days array and gave it the name getXyz(). That worked ok.
I noticed that the original getter and setter were asymetrical (hysterical reasons).
I know this is a bit wierd but it worked up til now. Anyway, I modified
the methods as follows:
The problem no longer occurs.
I have no explaination for why this fixes the problem as I think that only the getter is being used. This ‘solution’ is ok for me as the code looks better and it works.
(Feel free to add a comment if you know WHY this solves the problem)