-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Accessing set from jsp page
PostPosted: Thu Aug 24, 2006 4:56 pm 
Newbie

Joined: Wed Aug 09, 2006 2:36 pm
Posts: 2
Hello,

Maybe this is not a pure hibernate issue, but I'm sure that many people have ever had the same problem.
I have a Pojo with a Set attribute, representing a foreign key in other table:

public class Cliente {

.... attributes declarations

private Set alquileres = new HashSet();

..... getters and setters

}

The problem appears when I try to access to this attribute from a JSP page using Expression Language. I try this:

<td>${cliente.alquileres[0].codigo}</td>

But this doesn't work. Any idea?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 25, 2006 5:18 am 
Expert
Expert

Joined: Thu Sep 22, 2005 10:29 am
Posts: 285
Location: Almassera/Valencia/Spain/EU/Earth/Solar system/Milky Way/Local Group/Virgo Supercluster
Code:
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<html>

   <head>
      <title>Ejemplo</title>
   </head>

   <body>
      <table>
         <tr><th>Código del alquiler</th></tr>
      <c:forEach var="alquiler" items="cliente.alquileres">
         <tr><td>${alquiler.codigo}</td></tr>
      </c:forEach>
      </table>
   </body>
   
</html>


Repasa el capítulo sobre Collections de Java.
Y léete un buen libro sobre JSP.
Y que no se te olvide darme créditos ;-)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.