----- Original Message -----
From: "Francisco Hernandez" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 09, 2003 4:11 PM
Subject: Re: [OS-webwork] ScopeInterceptor


> can you write an example on how to use this interceptor?

Yes... I've got action having properties orderBy, length, from. I would like
to make those properties session-scoped. So I add interceptor like this
(excerpt from my code):

        <action name="customer.browse" class="foo.actions.BrowseAction">
            <result name="success" type="dispatcher">
                <param name="location">/browse/customer.jsp</param>
            </result>
            <param name="title">Browse Customers</param>
            <interceptor-ref name="scope">
             <param name="session">from,length,orderBy</param>
            </interceptor-ref>
            <interceptor-ref name="defaultHibernateStack"/>
        </action>

In other action I've got model bean that is attached to action's model
property. I can easily make it session-scoped.

<interceptor-ref name="scope">
    <param name="session">model</param.
</interceptor-ref>

This way I can do multi-request wizzard-like forms. AFAIR Pat was pointing
once that it's useful feature of Struts that you can attach form beans to
sessions. As for now, you can't attach whole action to session, but at least
you can do it for properties. In case you do use model-action separation,
you can do execactly the same as in Struts.

BTW: It's issue #WW-341.

-- Mike



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to