struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lixin Chu" <lixin....@gmail.com>
Subject Re: calling method of a bean from JSP
Date Fri, 15 Sep 2006 05:53:05 GMT
>
>
> What are you trying to achieve? Maybe you're trying to put logic in your
> JSPs that more properly belongs in an action.
>
>
thanks. what i am trying to do is to get the value of a field. Say I get a
list of items:

class item {
Set values;
...
}

The item has a set of Values:
class Value {
Attribute attribute;
String value;
}

What I wanted to do is to get one particular value based on attribute ID. in
this case I have to add a method in the Item class, someting like this:

String getValue (String id) {
  while (it.hasNext()) {
     Value value = (value) it.next();
     if (value.attribute.getId().toString().equals (id)
        return value.value;
  }

So from JSP, I would like to call this method <c:out value="${item.getValue
(id}"/>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message