You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Gianluca Musella <gi...@bsc.it> on 2009/02/09 00:06:35 UTC

model bean from a servlet

Hello list,
Is possible to access the model bean from a std servlet?

I think this is possible, because s2 store this model into the session
(or request) object, and presents it to the getModel() method of an
action implementing the ScopedModelDriven<MyModelClass>.

If this, I only need the name of this object.

Thank in advance

Gianluca

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


R: model bean from a servlet

Posted by Gianluca Musella <gi...@bsc.it>.
Hi Jack. Thank for your response.

The problem is that the login.jsp is called before the user authentication, performed through jaas, and in the <form-login-page> in the web.xml, is not possible to specify an action. So I heven't the possibility to pass the model to the login.jsp. 

The workaround is to abtain the model in a servlet and to pass it manually to the jsp.

That's all, can you help me?

Anyway thank you very much.

Gianluca

> -----Messaggio originale-----
> Da: Jack Qu [mailto:qujiakang@hotmail.com]
> Inviato: martedì 10 febbraio 2009 14.24
> A: Struts Users Mailing List
> Oggetto: Re: model bean from a servlet
> 
> Hi Gianluca
> 
> Why do you do this ,s2 is use to replace on control layer of MVC and model
> be put in valueStack on current thread,it 's  diffcultly to visit it in
> other thread!
> --------------------------------------------------
> From: "Gianluca Musella" <gi...@bsc.it>
> Sent: Monday, February 09, 2009 7:06 AM
> To: <us...@struts.apache.org>
> Subject: model bean from a servlet
> 
> >
> > Hello list,
> > Is possible to access the model bean from a std servlet?
> >
> > I think this is possible, because s2 store this model into the session
> > (or request) object, and presents it to the getModel() method of an
> > action implementing the ScopedModelDriven<MyModelClass>.
> >
> > If this, I only need the name of this object.
> >
> > Thank in advance
> >
> > Gianluca
> >
> > ---------------------------------------------------------------------
> > 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


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


Re: model bean from a servlet

Posted by Jack Qu <qu...@hotmail.com>.
Hi Gianluca

Why do you do this ,s2 is use to replace on control layer of MVC and model 
be put in valueStack on current thread,it 's  diffcultly to visit it in 
other thread!
--------------------------------------------------
From: "Gianluca Musella" <gi...@bsc.it>
Sent: Monday, February 09, 2009 7:06 AM
To: <us...@struts.apache.org>
Subject: model bean from a servlet

>
> Hello list,
> Is possible to access the model bean from a std servlet?
>
> I think this is possible, because s2 store this model into the session
> (or request) object, and presents it to the getModel() method of an
> action implementing the ScopedModelDriven<MyModelClass>.
>
> If this, I only need the name of this object.
>
> Thank in advance
>
> Gianluca
>
> ---------------------------------------------------------------------
> 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