You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mark <ma...@libero.it> on 2002/12/09 11:23:55 UTC

Lists, actions and links

Hello

I've having trouble working out which is the best way of iterating though a
result set , I can and have done this is several ways.

1. Imagine i have a class that querys a db and returns a result set. I pass
the result set as a datastructure to my action class and all is well .. But
I have to call the action to produce the list on my page.
E.g. 
        MyModelClassThatAsksTheDBForResults
        ListJismAction
         have an action listjism.do and link to this

2. or I have a bean that gets the resultset, via another class or in the
bean, I instantiate the bean using the useBean jsp syntax and then iterate
through using the gets defined in my bean. I don't have to have a list
action, but there's something that smells about this (i'm not sure what).
E.g.

    ListJismBean
    and have a normal link to listjism.jsp that uses a mix of standard jsp
and struts.

I know that the later is probably faster, but I'm not worried about that.
I'll worry about that once my app all works (albeit slowly). An additional
question is should i be only calling actions for every page or not, i read
different views on this which has confused me. It seems that centralising
all the links in action that can be adminstered from config.xml would only
be more maintainable if and only if everything is in there.

Many thanks in advance

mark




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>