You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Christian Benjamin Ries <ch...@fh-bielefeld.de> on 2009/05/19 23:48:17 UTC

Preload of database data?

Hi there,

I have a small site with some informations which are stored in a
database. A method for administrations reason is added to change the
content (names) of the datasets.

Now, I will add these names to my navigation.

I have a action like this:

<action name="Admin" class="bean.Admin">
   ...
</action>

This action edits the content of the bean "System".

I will add this bean content to all other actions in my navigation, but
I don't know the right way to solve this problem. Any suggestions?

Thx!

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


Re: Preload of database data?

Posted by Wes Wannemacher <we...@wantii.com>.
It's mostly a matter of preference, in some scenarios, using the
action tag makes more sense. There is information here -

http://cwiki.apache.org/WW/crud-demo-i.html#CRUDDemoI-Adding&Editinganemployee

-Wes

On Thu, May 21, 2009 at 10:37 AM, Luis Medina <lu...@gmail.com> wrote:
> Does anyone know which is the diference between "prepare data" using the
> Action Constructor and the prepare method?
>
> On Thu, May 21, 2009 at 6:18 AM, <st...@gmail.com> wrote:
>
>> You can prepare data by implemeting Preparable in your action
>>
>> On Tue, May 19, 2009 at 4:48 PM, Christian Benjamin Ries <
>> christian_benjamin.ries@fh-bielefeld.de> wrote:
>>
>> > Hi there,
>> >
>> > I have a small site with some informations which are stored in a
>> > database. A method for administrations reason is added to change the
>> > content (names) of the datasets.
>> >
>> > Now, I will add these names to my navigation.
>> >
>> > I have a action like this:
>> >
>> > <action name="Admin" class="bean.Admin">
>> >   ...
>> > </action>
>> >
>> > This action edits the content of the bean "System".
>> >
>> > I will add this bean content to all other actions in my navigation, but
>> > I don't know the right way to solve this problem. Any suggestions?
>> >
>> > Thx!
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>> >
>> >
>>
>
>
>
> --
> Luis Alberto Medina Bravo
> Skype: lalbertme
> Móvil: 553 715 5290
> MSN: luis.medina@acm.org
> --
> Worker bees can leave
> Even drones can fly away
> The queen is their slave
>



-- 
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

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


Re: Preload of database data?

Posted by Luis Medina <lu...@gmail.com>.
Thx! 4 the tip

On Fri, May 22, 2009 at 9:46 AM, Rene Gielen <gi...@it-neering.net> wrote:

> The main downside is that you will have nothing injected into your
> action by the time the constructor code is executed. Also, the params
> interceptor (as others placed before preparable) should not have taken
> any effects when action is instantiated.
> Another advantage of the prepare interceptor is the use of the
> paramsPrepareParams pattern which is extremly cool for CRUD stuff
>
> Luis Medina schrieb:
> > Does anyone know which is the diference between "prepare data" using the
> > Action Constructor and the prepare method?
> >
> > On Thu, May 21, 2009 at 6:18 AM, <st...@gmail.com> wrote:
> >
> >> You can prepare data by implemeting Preparable in your action
> >>
> >> On Tue, May 19, 2009 at 4:48 PM, Christian Benjamin Ries <
> >> christian_benjamin.ries@fh-bielefeld.de> wrote:
> >>
> >>> Hi there,
> >>>
> >>> I have a small site with some informations which are stored in a
> >>> database. A method for administrations reason is added to change the
> >>> content (names) of the datasets.
> >>>
> >>> Now, I will add these names to my navigation.
> >>>
> >>> I have a action like this:
> >>>
> >>> <action name="Admin" class="bean.Admin">
> >>>   ...
> >>> </action>
> >>>
> >>> This action edits the content of the bean "System".
> >>>
> >>> I will add this bean content to all other actions in my navigation, but
> >>> I don't know the right way to solve this problem. Any suggestions?
> >>>
> >>> Thx!
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>> For additional commands, e-mail: user-help@struts.apache.org
> >>>
> >>>
> >
> >
> >
>
> --
> René Gielen
> IT-Neering.net
> Saarstrasse 100, 52062 Aachen, Germany
> Tel: +49-(0)241-4010770
> Fax: +49-(0)241-4010771
> Cel: +49-(0)177-3194448
> http://twitter.com/rgielen
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Luis Alberto Medina Bravo
Skype: lalbertme
Móvil: 553 715 5290
MSN: luis.medina@acm.org
--
Worker bees can leave
Even drones can fly away
The queen is their slave

Re: Preload of database data?

Posted by Rene Gielen <gi...@it-neering.net>.
The main downside is that you will have nothing injected into your
action by the time the constructor code is executed. Also, the params
interceptor (as others placed before preparable) should not have taken
any effects when action is instantiated.
Another advantage of the prepare interceptor is the use of the
paramsPrepareParams pattern which is extremly cool for CRUD stuff

Luis Medina schrieb:
> Does anyone know which is the diference between "prepare data" using the
> Action Constructor and the prepare method?
> 
> On Thu, May 21, 2009 at 6:18 AM, <st...@gmail.com> wrote:
> 
>> You can prepare data by implemeting Preparable in your action
>>
>> On Tue, May 19, 2009 at 4:48 PM, Christian Benjamin Ries <
>> christian_benjamin.ries@fh-bielefeld.de> wrote:
>>
>>> Hi there,
>>>
>>> I have a small site with some informations which are stored in a
>>> database. A method for administrations reason is added to change the
>>> content (names) of the datasets.
>>>
>>> Now, I will add these names to my navigation.
>>>
>>> I have a action like this:
>>>
>>> <action name="Admin" class="bean.Admin">
>>>   ...
>>> </action>
>>>
>>> This action edits the content of the bean "System".
>>>
>>> I will add this bean content to all other actions in my navigation, but
>>> I don't know the right way to solve this problem. Any suggestions?
>>>
>>> Thx!
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
> 
> 
> 

-- 
René Gielen
IT-Neering.net
Saarstrasse 100, 52062 Aachen, Germany
Tel: +49-(0)241-4010770
Fax: +49-(0)241-4010771
Cel: +49-(0)177-3194448
http://twitter.com/rgielen

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


Re: Preload of database data?

Posted by Luis Medina <lu...@gmail.com>.
Does anyone know which is the diference between "prepare data" using the
Action Constructor and the prepare method?

On Thu, May 21, 2009 at 6:18 AM, <st...@gmail.com> wrote:

> You can prepare data by implemeting Preparable in your action
>
> On Tue, May 19, 2009 at 4:48 PM, Christian Benjamin Ries <
> christian_benjamin.ries@fh-bielefeld.de> wrote:
>
> > Hi there,
> >
> > I have a small site with some informations which are stored in a
> > database. A method for administrations reason is added to change the
> > content (names) of the datasets.
> >
> > Now, I will add these names to my navigation.
> >
> > I have a action like this:
> >
> > <action name="Admin" class="bean.Admin">
> >   ...
> > </action>
> >
> > This action edits the content of the bean "System".
> >
> > I will add this bean content to all other actions in my navigation, but
> > I don't know the right way to solve this problem. Any suggestions?
> >
> > Thx!
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>



-- 
Luis Alberto Medina Bravo
Skype: lalbertme
Móvil: 553 715 5290
MSN: luis.medina@acm.org
--
Worker bees can leave
Even drones can fly away
The queen is their slave

Re: Preload of database data?

Posted by st...@gmail.com.
You can prepare data by implemeting Preparable in your action

On Tue, May 19, 2009 at 4:48 PM, Christian Benjamin Ries <
christian_benjamin.ries@fh-bielefeld.de> wrote:

> Hi there,
>
> I have a small site with some informations which are stored in a
> database. A method for administrations reason is added to change the
> content (names) of the datasets.
>
> Now, I will add these names to my navigation.
>
> I have a action like this:
>
> <action name="Admin" class="bean.Admin">
>   ...
> </action>
>
> This action edits the content of the bean "System".
>
> I will add this bean content to all other actions in my navigation, but
> I don't know the right way to solve this problem. Any suggestions?
>
> Thx!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>