You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by pilou <gp...@sopragroup.com> on 2007/10/08 11:47:38 UTC

getModel() invoked twice ?

I am trying to use the ModelDriven interface.
getModel on the Bean is invoked twice before th execute() invocation ant
once after. 
It does not seem to be the right "normal" sequence ?
I implements the defaultStack.
could you help ?
thanks


more details :
==========
version struts 2.09

		<action name="RecherchePersonne_*"
class="exemple.action.admin.PersonneListAction" method="{1}">
			<result>/WEB-INF/pages/admin/personneList.jsp</result>
		</action>


public class PersonneListAction extends ExempleAction implements
      ModelDriven<PersonneFilterBean> {

   private static final long serialVersionUID = -2355406819601885551L;

   @Override
   public String execute() throws Exception {
      getLog().debug("OK success !");
      return SUCCESS;
   }
   
   /**
    * Routine appelé pour voir la page de recherche.
    * @return
    */
   public String forList() {
      getLog().debug("OK success !");
     return SUCCESS;   
   }
   
   /**
    * Routine appelé pour executer la recherche.
    * @return
    */
   public String list() {
      getLog().debug("OK success !");
      return SUCCESS;   
   }
   

   public PersonneFilterBean getModel() {
      getLog().debug("OK success !");
      PersonneFilterBean filter = new  PersonneFilterBean();
      filter.setNom("entrer le nom");
      return filter;
   }
}
-- 
View this message in context: http://www.nabble.com/getModel%28%29-invoked-twice---tf4587069.html#a13093504
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: getModel() invoked twice ?

Posted by Wes Wannemacher <we...@wantii.com>.
I filed a JIRA a while back that included this and two other possible issues.

http://jira.opensymphony.com/browse/XW-569

-W

On 10/8/07, Dave Newton <ne...@yahoo.com> wrote:
> The current XWork ModelDriven interceptor code does
> call getModel() twice; this was brought up during an
> unrelated conversation a couple of weeks ago.
>
> I don't know if anybody filed a JIRA against XWork for
> it or not.
>
> d.
>
> --- pilou <gp...@sopragroup.com> wrote:
>
> >
> > I am trying to use the ModelDriven interface.
> > getModel on the Bean is invoked twice before th
> > execute() invocation ant
> > once after.
> > It does not seem to be the right "normal" sequence ?
> > I implements the defaultStack.
> > could you help ?
> > thanks
> >
> >
> > more details :
> > ==========
> > version struts 2.09
> >
> >               <action name="RecherchePersonne_*"
> > class="exemple.action.admin.PersonneListAction"
> > method="{1}">
> >
> >
> <result>/WEB-INF/pages/admin/personneList.jsp</result>
> >               </action>
> >
> >
> > public class PersonneListAction extends
> > ExempleAction implements
> >       ModelDriven<PersonneFilterBean> {
> >
> >    private static final long serialVersionUID =
> > -2355406819601885551L;
> >
> >    @Override
> >    public String execute() throws Exception {
> >       getLog().debug("OK success !");
> >       return SUCCESS;
> >    }
> >
> >    /**
> >     * Routine appelé pour voir la page de recherche.
> >     * @return
> >     */
> >    public String forList() {
> >       getLog().debug("OK success !");
> >      return SUCCESS;
> >    }
> >
> >    /**
> >     * Routine appelé pour executer la recherche.
> >     * @return
> >     */
> >    public String list() {
> >       getLog().debug("OK success !");
> >       return SUCCESS;
> >    }
> >
> >
> >    public PersonneFilterBean getModel() {
> >       getLog().debug("OK success !");
> >       PersonneFilterBean filter = new
> > PersonneFilterBean();
> >       filter.setNom("entrer le nom");
> >       return filter;
> >    }
> > }
> > --
> > View this message in context:
> >
> http://www.nabble.com/getModel%28%29-invoked-twice---tf4587069.html#a13093504
> > Sent from the Struts - User mailing list archive at
> > Nabble.com.
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> > user-help@struts.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Wesley Wannemacher
President, Head Engineer/Consultant
WanTii, Inc.
http://www.wantii.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: getModel() invoked twice ?

Posted by Dave Newton <ne...@yahoo.com>.
The current XWork ModelDriven interceptor code does
call getModel() twice; this was brought up during an
unrelated conversation a couple of weeks ago.

I don't know if anybody filed a JIRA against XWork for
it or not.

d.

--- pilou <gp...@sopragroup.com> wrote:

> 
> I am trying to use the ModelDriven interface.
> getModel on the Bean is invoked twice before th
> execute() invocation ant
> once after. 
> It does not seem to be the right "normal" sequence ?
> I implements the defaultStack.
> could you help ?
> thanks
> 
> 
> more details :
> ==========
> version struts 2.09
> 
> 		<action name="RecherchePersonne_*"
> class="exemple.action.admin.PersonneListAction"
> method="{1}">
> 		
>
<result>/WEB-INF/pages/admin/personneList.jsp</result>
> 		</action>
> 
> 
> public class PersonneListAction extends
> ExempleAction implements
>       ModelDriven<PersonneFilterBean> {
> 
>    private static final long serialVersionUID =
> -2355406819601885551L;
> 
>    @Override
>    public String execute() throws Exception {
>       getLog().debug("OK success !");
>       return SUCCESS;
>    }
>    
>    /**
>     * Routine appelé pour voir la page de recherche.
>     * @return
>     */
>    public String forList() {
>       getLog().debug("OK success !");
>      return SUCCESS;   
>    }
>    
>    /**
>     * Routine appelé pour executer la recherche.
>     * @return
>     */
>    public String list() {
>       getLog().debug("OK success !");
>       return SUCCESS;   
>    }
>    
> 
>    public PersonneFilterBean getModel() {
>       getLog().debug("OK success !");
>       PersonneFilterBean filter = new 
> PersonneFilterBean();
>       filter.setNom("entrer le nom");
>       return filter;
>    }
> }
> -- 
> View this message in context:
>
http://www.nabble.com/getModel%28%29-invoked-twice---tf4587069.html#a13093504
> Sent from the Struts - User mailing list archive at
> Nabble.com.
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org