javax.servlet.jsp.el.ELException: Attempt to coerce a value of type
843838Dec 5 2005 — edited Dec 5 2005I've written a web service to retrieve informations from the database based on a client's criteria. The service endpoint is the following:
public WSMissionBean getProfiles( WSMissionBean mission, WSProfileBean profile ) throws java.rmi.RemoteException;
The WSMissionBean object is as follows:
public class WSMissionBean implements Serializable {
...
private WSProfileBean[] lstProfile;
private WSProfileBean[] lstProfileMoinsQualifie;
private WSProfileBean[] lstProfileByPoste;
private WSProfileBean[] lstProfileByCompetences;
}
And WSProfileBean is an object containing just simple data types. The whole idea is to have an object which, besides the criteria entered by a client, holds differents arrays, each of which answers a certain number of criteria required by the client.
The service is deployed correctly, and I can access it, from a stand alone simple program, to retrieve data from the database as expected. The big problem is when I try to show the results in a JSP page! And the error message is:
javax.servlet.jsp.el.ELException: Attempt to coerce a value of type "[Lclient.WSProfileBean;" to type "java.lang.reflect.Array"
My JSP pages are as follows:
<table border=0 cellspacing=1 cellpadding=3>
<%-- sessionScope.mission.profiles contain data return by the web service, and gr:listRenderer is a tag file to show the result--%>
<gr:listRenderer list="${sessionScope.mission.profiles}" />
</table>
And in the tag file, I have
<%@ attribute name="list" required="true" type="java.lang.reflect.Array" %>
<c:forEach var="profile" begin="0" items="${list}">
<tr>
<c:set var="profileId" value="${profile.id}" />
<c:if test="${profile.selected}" >
<td bgcolor="#0099FF"><input type="checkbox" name="${profileId}" checked="checked"/></td>
</c:if>
<c:if test="${!profile.selected}" >
<td bgcolor="#0099FF"><input type="checkbox" name="${profileId}"/></td>
</c:if>
<td bgcolor="#0099FF"><font face="Verdana, Arial" size="2">${profile.nom}</font></td>
<td bgcolor="#0099FF"><font face="Verdana, Arial" size="2">${profile.preNom}</font></td>
<td bgcolor="#0099FF"><font face="Verdana, Arial" size="2">${profile.fonction}</font></td>
<td bgcolor="#0099FF"><font face="Verdana, Arial" size="2">${profile.competences}</font></td>
<td bgcolor="#0099FF"><font face="Verdana, Arial" size="2">${profile.nbAnneeExperience}</font></td>
<td bgcolor="#0099FF"><font face="Verdana, Arial" size="2"><a target="_blank" href="./doc/myCV.html"><image border="0" alt="CV d�taill�" src="./image/cv.gif"/></a></font></td>
</tr>
</c:forEach>
I've been searching desperately for days on the web for an answer, but to no result! I appreciate if someone can give me some advice, explanation... Thanks in advance
Van Binh