You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Aum Strut <au...@gmail.com> on 2012/06/28 17:35:10 UTC

Using Base Action for application (struts2)

Hi All,

I am not sure how to do this, i am planning to create a BaseAction class
and will do some init type work here which should be available to each and
every action without need to call that specific method.

Idea is to create a property which is needed by each and every
Action/Request and i don't want to call that method from each and every
action.

is there a way to achieve this?

Re: Re: Using Base Action for application (struts2)

Posted by Aum Strut <au...@gmail.com>.
I am planning to create  path (web-root path), like kind of application
specific variable with whome i can refer all my CSS,JS and images

though i can do it with simple JSTL etc but want to create a simple approach

its quite possible i  might be entirely wrong here in term of approach

On Thu, Jun 28, 2012 at 10:23 PM, samsongbest <sa...@gmail.com> wrote:

> Hi,
>
> Maybe my understanding is wrong. Please go ahead.
>
>
>
>
> Best Regards,
> Sam Song
> Cognizant Technology Solutions
>
> From: vEnkaTa mohAna rAo SriperumbUdUru
> Date: 2012-06-29 01:21
> To: Struts Users Mailing List; samsongbest
> Subject: Re: Re: Using Base Action for application (struts2)
> Hi,
>
> What you want to do here, explain to us if so we can provide better
> solutions how it should be done in struts2 style.
>
> Java Rocks.
>
>
> On Thu, Jun 28, 2012 at 9:44 PM, samsongbest <sa...@gmail.com>
> wrote:
>
> Hi Aum,
>
> Let me give you some simple code.
>
> public Class BaseAction{
>
> //constructor method
> public BaseAction() {
> property = ...;
> }
>
> String property;
>
> //get
> //set
> }
>
> I think any other action extends BaseAction can use "property" directly
> without calling any other method.
> Is that what you want?
>
>
>
>
>
> Best Regards,
> Sam Song
> Cognizant Technology Solutions
>
> From: Aum Strut
>
> Date: 2012-06-29 00:36
> To: samsongbest
> CC: Struts Users Mailing List
> Subject: Re: Using Base Action for application (struts2)
>
> I am not sure what you mean by constructor method??
>  u mean prepare method??
>
>
> On Thu, Jun 28, 2012 at 9:19 PM, samsongbest <sa...@gmail.com>
> wrote:
>
>
> Hi Aum,
>
> How about put the init type work in the constructor method of the
> BaseAction?
>
>
>
>
>
> Best Regards,
> Sam Song
> Cognizant Technology Solutions
>
> From: Aum Strut
> Date: 2012-06-29 00:05
> To: Struts Users Mailing List
>
> Subject: Using Base Action for application (struts2)
>
> Hi All,
>
> I am not sure how to do this, i am planning to create a BaseAction class
> and will do some init type work here which should be available to each and
> every action without need to call that specific method.
>
> Idea is to create a property which is needed by each and every
> Action/Request and i don't want to call that method from each and every
> action.
>
> is there a way to achieve this?
>

Re: Re: Using Base Action for application (struts2)

Posted by samsongbest <sa...@gmail.com>.
Hi,

Maybe my understanding is wrong. Please go ahead.




Best Regards,
Sam Song
Cognizant Technology Solutions

From: vEnkaTa mohAna rAo SriperumbUdUru
Date: 2012-06-29 01:21
To: Struts Users Mailing List; samsongbest
Subject: Re: Re: Using Base Action for application (struts2)
Hi,

What you want to do here, explain to us if so we can provide better solutions how it should be done in struts2 style.

Java Rocks.


On Thu, Jun 28, 2012 at 9:44 PM, samsongbest <sa...@gmail.com> wrote:

Hi Aum,

Let me give you some simple code.

public Class BaseAction{

//constructor method
public BaseAction() {
property = ...;
}

String property;

//get
//set
}

I think any other action extends BaseAction can use "property" directly without calling any other method.
Is that what you want?





Best Regards,
Sam Song
Cognizant Technology Solutions

From: Aum Strut

Date: 2012-06-29 00:36
To: samsongbest
CC: Struts Users Mailing List
Subject: Re: Using Base Action for application (struts2)

I am not sure what you mean by constructor method??
 u mean prepare method??


On Thu, Jun 28, 2012 at 9:19 PM, samsongbest <sa...@gmail.com> wrote:


Hi Aum,

How about put the init type work in the constructor method of the BaseAction?





Best Regards,
Sam Song
Cognizant Technology Solutions

From: Aum Strut
Date: 2012-06-29 00:05
To: Struts Users Mailing List

Subject: Using Base Action for application (struts2)

Hi All,

I am not sure how to do this, i am planning to create a BaseAction class
and will do some init type work here which should be available to each and
every action without need to call that specific method.

Idea is to create a property which is needed by each and every
Action/Request and i don't want to call that method from each and every
action.

is there a way to achieve this?

Re: Re: Using Base Action for application (struts2)

Posted by vEnkaTa mohAna rAo SriperumbUdUru <mo...@gmail.com>.
Hi,

What you want to do here, explain to us if so we can provide better
solutions how it should be done in struts2 style.

Java Rocks.

On Thu, Jun 28, 2012 at 9:44 PM, samsongbest <sa...@gmail.com> wrote:

> Hi Aum,
>
> Let me give you some simple code.
>
> public Class BaseAction{
>
> //constructor method
> public BaseAction() {
> property = ...;
> }
>
> String property;
>
> //get
> //set
> }
>
> I think any other action extends BaseAction can use "property" directly
> without calling any other method.
> Is that what you want?
>
>
>
>
> Best Regards,
> Sam Song
> Cognizant Technology Solutions
>
> From: Aum Strut
> Date: 2012-06-29 00:36
> To: samsongbest
> CC: Struts Users Mailing List
> Subject: Re: Using Base Action for application (struts2)
> I am not sure what you mean by constructor method??
>  u mean prepare method??
>
>
> On Thu, Jun 28, 2012 at 9:19 PM, samsongbest <sa...@gmail.com>
> wrote:
>
> Hi Aum,
>
> How about put the init type work in the constructor method of the
> BaseAction?
>
>
>
>
> Best Regards,
> Sam Song
> Cognizant Technology Solutions
>
> From: Aum Strut
> Date: 2012-06-29 00:05
> To: Struts Users Mailing List
> Subject: Using Base Action for application (struts2)
> Hi All,
>
> I am not sure how to do this, i am planning to create a BaseAction class
> and will do some init type work here which should be available to each and
> every action without need to call that specific method.
>
> Idea is to create a property which is needed by each and every
> Action/Request and i don't want to call that method from each and every
> action.
>
> is there a way to achieve this?
>

Re: Re: Using Base Action for application (struts2)

Posted by samsongbest <sa...@gmail.com>.
Hi Aum,

Let me give you some simple code.

public Class BaseAction{

//constructor method
public BaseAction() {
property = ...;
}

String property;

//get
//set
}

I think any other action extends BaseAction can use "property" directly without calling any other method. 
Is that what you want?




Best Regards,
Sam Song
Cognizant Technology Solutions

From: Aum Strut
Date: 2012-06-29 00:36
To: samsongbest
CC: Struts Users Mailing List
Subject: Re: Using Base Action for application (struts2)
I am not sure what you mean by constructor method??
 u mean prepare method??


On Thu, Jun 28, 2012 at 9:19 PM, samsongbest <sa...@gmail.com> wrote:

Hi Aum,

How about put the init type work in the constructor method of the BaseAction?




Best Regards,
Sam Song
Cognizant Technology Solutions

From: Aum Strut
Date: 2012-06-29 00:05
To: Struts Users Mailing List
Subject: Using Base Action for application (struts2)
Hi All,

I am not sure how to do this, i am planning to create a BaseAction class
and will do some init type work here which should be available to each and
every action without need to call that specific method.

Idea is to create a property which is needed by each and every
Action/Request and i don't want to call that method from each and every
action.

is there a way to achieve this?

Re: Using Base Action for application (struts2)

Posted by Aum Strut <au...@gmail.com>.
I am not sure what you mean by constructor method??
 u mean prepare method??

On Thu, Jun 28, 2012 at 9:19 PM, samsongbest <sa...@gmail.com> wrote:

> **
> Hi Aum,
>
> How about put the init type work in the constructor method of the
> BaseAction?
>
> ------------------------------
>
> Best Regards,****
>
> *Sam Song*
>
> *Cognizant Technology Solutions <http://www.cognizant.com/>*
>
>  *From:* Aum Strut <au...@gmail.com>
> *Date:* 2012-06-29 00:05
> *To:* Struts Users Mailing List <us...@struts.apache.org>
> *Subject:* Using Base Action for application (struts2)
>  Hi All,
>
> I am not sure how to do this, i am planning to create a BaseAction class
> and will do some init type work here which should be available to each and
> every action without need to call that specific method.
>
> Idea is to create a property which is needed by each and every
> Action/Request and i don't want to call that method from each and every
> action.
>
> is there a way to achieve this?
>
>

Re: Using Base Action for application (struts2)

Posted by samsongbest <sa...@gmail.com>.
Hi Aum,

How about put the init type work in the constructor method of the BaseAction?




Best Regards,
Sam Song
Cognizant Technology Solutions

From: Aum Strut
Date: 2012-06-29 00:05
To: Struts Users Mailing List
Subject: Using Base Action for application (struts2)
Hi All,

I am not sure how to do this, i am planning to create a BaseAction class
and will do some init type work here which should be available to each and
every action without need to call that specific method.

Idea is to create a property which is needed by each and every
Action/Request and i don't want to call that method from each and every
action.

is there a way to achieve this?