struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mead Lai <>
Subject ONGL & EL expression problem.
Date Mon, 08 Nov 2010 15:33:25 GMT
Hello all,

I have a Action contain a list List<adminTitleVO>, and a String property
titleID, how to display the value from list?
Detail code is here:
public class IndexAction{
private List<AdminTitleVO> list;
private String titleID;
//get & set ....
  public String viewPage()

simple data list
      this.list = BS.getAdminTitleList();
     //set a id
      this.titleID = "a5";
      return "view";

public class AdminTitle{
  private String id;
  private String name;
// get & set ...

//**************JSP page******
<s:select list="list" listKey="id" listValue="name" value="a4"/>, 'user'
item will be selected.
Now, I want to display the name in plain text way! Get the name by titleID
in the Action
${list[0].name}, I can get first item from List, and display the name=
${list[titleID].name} is showing Error on page.
How can I get the "" on the page, by the certain

The following code run fine.
<s:iterator value="list.{? == 'a4'}">
      <s:property value="name" /> :<s:property value="id" />
<s:iterator value="list.{? == titleID'}">
      <s:property value="name" /> :<s:property value="id" />
it show nothing...
What shall I do to pass the "this.titleID" in the Action into the struts2


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