For editing an article, i use this action, and of course i don't come from a
submitted form :

        <action path="/article/edit"
                        type="com.xxx.ArticleAction"
                        name="articleForm"
                        scope="request"
                        validate="false">
                <forward name="success" path="/pages/article.vm"/>
        </action>

And i use the folowing attributes
(name="articleForm",scope="request",validate="false") only for not
instanciating myself an articleForm in my ArticleAction, then i can populate
it and render it with article.vm.
My question is : what is the best practice ?
1/ My lazzy way to get an instance of articleForm
2/ Put this code before populating the form bean ?
        if (form == null) {
            form = new ArticleForm();
            if ("request".equals(mapping.getScope()))
                request.setAttribute(mapping.getAttribute(), form);
            else
                session.setAttribute(mapping.getAttribute(), form);
        }

Thank you
Richard.


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

Reply via email to