struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jordi Rubio Moreno" <>
Subject [S2] Using complex objects in JSP
Date Thu, 10 May 2007 16:28:36 GMT
I'm newbie in Struts, and I have begin with Struts 2. I have an
ActionSupport object that contains a complex object TResultSet (this
object communicates with a remote server and this server sends a lot of
information that is stored into the TResultSet client).
class TResultSet
    private HashMap data;
    public boolean hasNext();
    public String getField(String key);
class A extends ActionSupport
    public String execute()
        TResultSet res = new TResultSet();
        return ActionSupport.SUCCESS;
If I was programming with JSP and servlets, I would codify something
        <% TResultSet res = request.getAttribute("resultSet"); %>
            <% do { %>
                    <td><% res.getField("ID") %></td>
                    <td><% res.getField("Name") %></td>
                    <td><% res.getField("Url") %></td>
            <% while (res.hasNext()); %>
How can I do this with Struts 2 without using JSP scripting? I was
thinking on build an array on Strings into the ActionSupport with the
TResultSet data, put it into a member variable of A, and then use
something like iterator tags, but I need to know if Struts is able to
work with complex objects and its funtions.
Thanks a lot in advance for you time!!

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