Hi list

I'm trying to use the options tag and am stuck with this problem:
I hold all 'Model' information in a single model object in the HttpSession.
Initialization for the Collection used by the <options> , held in an
ActionForm, must come from there (first time the view that uses that form is
displayed).
I'd have loved populate the Collection in the ActionForm, like so:

if(this.getSearches() == null){
        ArrayList al = new ArrayList();
        Search[] ss = model.getSearches();
        for( int i=0; i<ss.length; i++){
                Search s = ss[i];
                al.add(s);
        }
        this.setSearches(al);
}               

if(this.getCurrSearch() == null){
        this.setCurrSearch( model.getSearches()[0] );
}

... where 'model' comes from the session. 
Problem: I can't seem to reach the session from the ActionForm.
I then resorted to do the populating from the associated action, where
reaching the session is no problem, BUT: the action that's associated with
this form (to deal with its values when the user enters something) is not
the action that first leads to the view (JSP) that uses that form.

The action that does lead to that view is associated with a different
ActionForm (obviously), so I can't use it to populate it with init values.

I'm considering forwarding from Action to Action, but I'm wondering if
that's the right way to do it.


-- 
NEU : GMX Internet.FreeDSL
Ab sofort DSL-Tarif ohne Grundgebühr: http://www.gmx.net/dsl


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to