You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mike Young <mi...@e-mage.com.au> on 2004/07/22 10:36:42 UTC

Jsp to pass Bean back/on to Action

I have developed pages and seen examples where a bean is passed from an
action to a jsp but how do I pass the bean on to an action when it is 
called by the jsp either by a submit or a hyperlink.

Note I want to pass a bean (array of info) rather than a simple 
parameter = value?

A pointer in the right direction would be very much obliged.







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


Re: Jsp to pass Bean back/on to Action

Posted by Shailender Jain <sh...@teleatlas.com>.
May be you can put the bean in the session scope and then
retreive the bean in the Action class.
Not sure if this will be the right practice.

Mike Young wrote:

> I have developed pages and seen examples where a bean is passed from an
> action to a jsp but how do I pass the bean on to an action when it is
> called by the jsp either by a submit or a hyperlink.
>
> Note I want to pass a bean (array of info) rather than a simple
> parameter = value?
>
> A pointer in the right direction would be very much obliged.
>
> ---------------------------------------------------------------------
> 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: Jsp to pass Bean back/on to Action

Posted by Erik Weber <er...@mindspring.com>.
Sounds like you will need to either use session scope to store your 
data, so that it lasts longer than a single request, or else render a 
hidden variable in a form to contain your values (this can be multiple 
values) that the next action can get and possibly parse. I think Struts 
"indexed properties" might help. Also it might help you to learn about 
using session-scoped form beans (ActionForms).

Without knowing exactly what you are trying to do, I suggest 
session-scoping your bean as a first idea.

Hope that helps.

Erik



Mike Young wrote:

>I have developed pages and seen examples where a bean is passed from an
>action to a jsp but how do I pass the bean on to an action when it is 
>called by the jsp either by a submit or a hyperlink.
>
>Note I want to pass a bean (array of info) rather than a simple 
>parameter = value?
>
>A pointer in the right direction would be very much obliged.
>
>
>
>
>
>
>
>---------------------------------------------------------------------
>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