Using Struts 1.0.2 and Nested extension

The value attribute doesn't support the nested syntax of walking up a tree a la 
"../foo".  How is this result achieved?

In my JSP I have the following

<nested:root name="dependencies">
  <nested:iterate property="types">
    <nested:equal property="name" value="../currentType">
        Do stuff
    </nested:equal>
  </nested:iterate>
</nested:root>

class DepBean {  // available with session key 'dependencies'
  private String currentType;
  private Collection types;
  public String getCurrentType() { return currentType; }
  public Collection getTypes() { return types; }
  ...
}

public class DepType {
  private String name;
  public String getName() { return name; }
  ...
}

Even if I resort to specifying the value using a scriptlet, how can I get at the 
DepBean without having 

<%
  DepBean foo = (DepBean)session.getAttribute("dependencies");
  String currentType = foo.getCurrentType();
%>

and changing the <nested:equal> to

    <nested:equal property="name" value="<%=currentType%>">

Is this my only option?

Sri

Reply via email to