Hi konference 

I read the article there:
http://struts.apache.org/2.0.9/docs/scope-interceptor.html
and a want use scope interceptor, but it not work my. I dont know exactly,
that i good understand it.
I want save into session model: Employee. 

//############################
In my Action Class I have this code:
-----------------------------------
    public class TestScope extends ActionSupport implements
ModelDriven<Employee> {
                
        private Employee emp = new Employee(new Integer(10), "tomas", "jurman");

        public Employee getModel() {                            
              return emp;
    }

    public void setModel(Employee model) {
        this.emp = model;
    }
}

//###########################
in struts.xml I have this part of code:
note: instead tag param i give here tag para because it dont show it
-------------------------------------------------
<interceptors>
   <interceptor-stack name="eventStack">
        <interceptor-ref name="scope">
             <para name="session">model</para>   
             <para name="autoCreateSession">true</para>
       </interceptor-ref>
       <interceptor-ref name="paramsPrepareParamsStack"/>
    </interceptor-stack>
</interceptors>
   
<default-interceptor-ref name="eventStack" />
                                        
<action name="scopeStart" class="cz.jurman.scope.TestScope">
     <interceptor-ref name="eventStack">
             <para name="scope.type">start</para>
     </interceptor-ref>
    <result name="success">/jsp/start.jsp</result>
</action>
                
//#########################
in JSP i read the session:
----------------------------------------
<s:property value="%{#session.model}"  />


//###############################################
Thanks for help very much

Tomas Jurman
Czech Republic



-----
Tomas Jurman
Czech Republic
-- 
View this message in context: 
http://www.nabble.com/Scope-Interceptor-tp16787023p16787023.html
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to