Re: Struts2 (caching, valuestack, etc...) problem

2012-06-04 Thread Maurizio Cucchiara
Dave is right: daos and services are usually singletone, it looks like you
defined the result list as field and not like the return of a method
(sharing fields among method invocations also arises concurrency issues).

Sent from my mobile device, so please excuse typos and brevity.

Maurizio Cucchiara
Il giorno 04/giu/2012 23.03, "Omar Ngarigari"  ha
scritto:

> Just thought it would be good idea to update everyone here, I finally
> figured it out what was my problem. I was using spring in my DAO with
> @Service and @Autowired annotations. Apparantely, these annotation are
> singleton by default. I added @Scope("prototype") and everything works as
> expected. Thanks Maurizio and Chris for your help.
>
> Thanks,
>
>
> 
>  From: Maurizio Cucchiara 
> To: Struts Users Mailing List ; Omar Ngarigari <
> ngarigar...@yahoo.com>
> Sent: Monday, June 4, 2012 2:42 PM
> Subject: Re: Struts2 (caching, valuestack, etc...) problem
>
> Are you using spring plugin?
> Looks like you are using a previous initialized instance of your action
> class.
> If yes, ensure that the scope is prototype and not the default one (which
> is singletone)
>
> Sent from my mobile device, so please excuse typos and brevity.
>
> Maurizio Cucchiara
> Il giorno 04/giu/2012 20.10, "Omar Ngarigari"  ha
> scritto:
>
> > Hi All,
> >
> > I have developed an application using struts2.3.1.2, but I
> > am experiencing a weird situation that I have bumping my head for a week
> > now, but It does not go away.
> >
> > Scenario 1 - I have a query page (jsp) where I have to query database
> > based on the quarter date an input. If I entered a quarter that does not
> > have data in the database, I receive an appropriate error message saying
> > there is no record found. (That is fine!).
> >
> > Scenario 2 - On the same query page,  I entered a quarter date that has
> > record in the database, then a report is generated. (That is fine!)
> >
> > Scenario 3 - This is where I am having problem. I click on the back
> button
> > of the IE browser to navigate from the report page back to the query
> page,
> > and at the query page, I entered the same quarter date that I entered at
> > the scenario 1, I get the report that was generated on scenario2 rather
> > than error message as scenario1.
> >
> > I have searching all over the place, but not luck. I would appreciate any
> > help or clue to the problem.
> >
> > Thanks,
> >
> > Omar N.


Re: Struts2 (caching, valuestack, etc...) problem

2012-06-04 Thread Dave Newton
In general a DAO *would* be a singleton, though.

On Mon, Jun 4, 2012 at 5:03 PM, Omar Ngarigari wrote:

> Just thought it would be good idea to update everyone here, I finally
> figured it out what was my problem. I was using spring in my DAO with
> @Service and @Autowired annotations. Apparantely, these annotation are
> singleton by default. I added @Scope("prototype") and everything works as
> expected. Thanks Maurizio and Chris for your help.
>
> Thanks,
>
>
> 
>  From: Maurizio Cucchiara 
> To: Struts Users Mailing List ; Omar Ngarigari <
> ngarigar...@yahoo.com>
> Sent: Monday, June 4, 2012 2:42 PM
> Subject: Re: Struts2 (caching, valuestack, etc...) problem
>
> Are you using spring plugin?
> Looks like you are using a previous initialized instance of your action
> class.
> If yes, ensure that the scope is prototype and not the default one (which
> is singletone)
>
> Sent from my mobile device, so please excuse typos and brevity.
>
> Maurizio Cucchiara
> Il giorno 04/giu/2012 20.10, "Omar Ngarigari"  ha
> scritto:
>
> > Hi All,
> >
> > I have developed an application using struts2.3.1.2, but I
> > am experiencing a weird situation that I have bumping my head for a week
> > now, but It does not go away.
> >
> > Scenario 1 - I have a query page (jsp) where I have to query database
> > based on the quarter date an input. If I entered a quarter that does not
> > have data in the database, I receive an appropriate error message saying
> > there is no record found. (That is fine!).
> >
> > Scenario 2 - On the same query page,  I entered a quarter date that has
> > record in the database, then a report is generated. (That is fine!)
> >
> > Scenario 3 - This is where I am having problem. I click on the back
> button
> > of the IE browser to navigate from the report page back to the query
> page,
> > and at the query page, I entered the same quarter date that I entered at
> > the scenario 1, I get the report that was generated on scenario2 rather
> > than error message as scenario1.
> >
> > I have searching all over the place, but not luck. I would appreciate any
> > help or clue to the problem.
> >
> > Thanks,
> >
> > Omar N.


Re: Struts2 (caching, valuestack, etc...) problem

2012-06-04 Thread Omar Ngarigari
Just thought it would be good idea to update everyone here, I finally figured 
it out what was my problem. I was using spring in my DAO with @Service and 
@Autowired annotations. Apparantely, these annotation are singleton by default. 
I added @Scope("prototype") and everything works as expected. Thanks Maurizio 
and Chris for your help. 

Thanks, 



 From: Maurizio Cucchiara 
To: Struts Users Mailing List ; Omar Ngarigari 
 
Sent: Monday, June 4, 2012 2:42 PM
Subject: Re: Struts2 (caching, valuestack, etc...) problem
 
Are you using spring plugin?
Looks like you are using a previous initialized instance of your action
class.
If yes, ensure that the scope is prototype and not the default one (which
is singletone)

Sent from my mobile device, so please excuse typos and brevity.

Maurizio Cucchiara
Il giorno 04/giu/2012 20.10, "Omar Ngarigari"  ha
scritto:

> Hi All,
>
> I have developed an application using struts2.3.1.2, but I
> am experiencing a weird situation that I have bumping my head for a week
> now, but It does not go away.
>
> Scenario 1 - I have a query page (jsp) where I have to query database
> based on the quarter date an input. If I entered a quarter that does not
> have data in the database, I receive an appropriate error message saying
> there is no record found. (That is fine!).
>
> Scenario 2 - On the same query page,  I entered a quarter date that has
> record in the database, then a report is generated. (That is fine!)
>
> Scenario 3 - This is where I am having problem. I click on the back button
> of the IE browser to navigate from the report page back to the query page,
> and at the query page, I entered the same quarter date that I entered at
> the scenario 1, I get the report that was generated on scenario2 rather
> than error message as scenario1.
>
> I have searching all over the place, but not luck. I would appreciate any
> help or clue to the problem.
>
> Thanks,
>
> Omar N.

Re: Struts2 (caching, valuestack, etc...) problem

2012-06-04 Thread Omar Ngarigari
I added the scope to prototype in my spring beans definitions. However, the 
problem persisting. I deleted my browser history and ran the application.



 From: Maurizio Cucchiara 
To: Struts Users Mailing List ; Omar Ngarigari 
 
Sent: Monday, June 4, 2012 2:42 PM
Subject: Re: Struts2 (caching, valuestack, etc...) problem
 

Are you using spring plugin?
Looks like you are using a previous initialized instance of your action class.
If yes, ensure that the scope is prototype and not the default one (which is 
singletone)
Sent from my mobile device, so please excuse typos and brevity.
Maurizio Cucchiara
Il giorno 04/giu/2012 20.10, "Omar Ngarigari"  ha 
scritto:

Hi All,
>
>I have developed an application using struts2.3.1.2, but I 
>am experiencing a weird situation that I have bumping my head for a week now, 
>but It does not go away. 
>
>Scenario 1 - I have a query page (jsp) where I have to query database based on 
>the quarter date an input. If I entered a quarter that does not have data in 
>the database, I receive an appropriate error message saying there is no record 
>found. (That is fine!).
>
>Scenario 2 - On the same query page,  I entered a quarter date that has record 
>in the database, then a report is generated. (That is fine!)
>
>Scenario 3 - This is where I am having problem. I click on the back button of 
>the IE browser to navigate from the report page back to the query page, and at 
>the query page, I entered the same quarter date that I entered at the scenario 
>1, I get the report that was generated on scenario2 rather than error message 
>as scenario1.
>
>I have searching all over the place, but not luck. I would appreciate any help 
>or clue to the problem.
>
>Thanks,
>
>Omar N. 

Re: Struts2 (caching, valuestack, etc...) problem

2012-06-04 Thread Omar Ngarigari
You might be right.  I am using spring-plugin and my beans definition are not 
set to any scope. I will try to use prototype. Thanks a lot, let me make the 
changes and I will let you know my findings.



 From: Maurizio Cucchiara 
To: Struts Users Mailing List ; Omar Ngarigari 
 
Sent: Monday, June 4, 2012 2:42 PM
Subject: Re: Struts2 (caching, valuestack, etc...) problem
 
Are you using spring plugin?
Looks like you are using a previous initialized instance of your action
class.
If yes, ensure that the scope is prototype and not the default one (which
is singletone)

Sent from my mobile device, so please excuse typos and brevity.

Maurizio Cucchiara
Il giorno 04/giu/2012 20.10, "Omar Ngarigari"  ha
scritto:

> Hi All,
>
> I have developed an application using struts2.3.1.2, but I
> am experiencing a weird situation that I have bumping my head for a week
> now, but It does not go away.
>
> Scenario 1 - I have a query page (jsp) where I have to query database
> based on the quarter date an input. If I entered a quarter that does not
> have data in the database, I receive an appropriate error message saying
> there is no record found. (That is fine!).
>
> Scenario 2 - On the same query page,  I entered a quarter date that has
> record in the database, then a report is generated. (That is fine!)
>
> Scenario 3 - This is where I am having problem. I click on the back button
> of the IE browser to navigate from the report page back to the query page,
> and at the query page, I entered the same quarter date that I entered at
> the scenario 1, I get the report that was generated on scenario2 rather
> than error message as scenario1.
>
> I have searching all over the place, but not luck. I would appreciate any
> help or clue to the problem.
>
> Thanks,
>
> Omar N.

Re: Struts2 (caching, valuestack, etc...) problem

2012-06-04 Thread Maurizio Cucchiara
Are you using spring plugin?
Looks like you are using a previous initialized instance of your action
class.
If yes, ensure that the scope is prototype and not the default one (which
is singletone)

Sent from my mobile device, so please excuse typos and brevity.

Maurizio Cucchiara
Il giorno 04/giu/2012 20.10, "Omar Ngarigari"  ha
scritto:

> Hi All,
>
> I have developed an application using struts2.3.1.2, but I
> am experiencing a weird situation that I have bumping my head for a week
> now, but It does not go away.
>
> Scenario 1 - I have a query page (jsp) where I have to query database
> based on the quarter date an input. If I entered a quarter that does not
> have data in the database, I receive an appropriate error message saying
> there is no record found. (That is fine!).
>
> Scenario 2 - On the same query page,  I entered a quarter date that has
> record in the database, then a report is generated. (That is fine!)
>
> Scenario 3 - This is where I am having problem. I click on the back button
> of the IE browser to navigate from the report page back to the query page,
> and at the query page, I entered the same quarter date that I entered at
> the scenario 1, I get the report that was generated on scenario2 rather
> than error message as scenario1.
>
> I have searching all over the place, but not luck. I would appreciate any
> help or clue to the problem.
>
> Thanks,
>
> Omar N.


Re: Struts2 (caching, valuestack, etc...) problem

2012-06-04 Thread Chris Pratt
You have to find the cache first.  It could be cached by the browser, the
server, the container or your application.  If every request is making it
through to your action, then it's most likely code in your application
that's reusing something from the last request.  If some of the requests
don't trigger your action, the problem is in one of the other three layers
and you'll have to do some investigation to figure out which (something
like TamperData Plug-in for FireFox might help)
  (*Chris*)

On Mon, Jun 4, 2012 at 11:37 AM, Omar Ngarigari wrote:

> I am running the application on jboss6 app server. I don't see anything on
> server console. I have debugged the app, I can see that the new input
> quarter date is returned when the request is made on the app log file. I
> tried your suggestions by adding ?something=kskdsds at the end of the url,
> but I got no record found. Can you show me how to clean a cache?
>
>
> 
>  From: Chris Pratt 
> To: Struts Users Mailing List ; Omar Ngarigari <
> ngarigar...@yahoo.com>
> Sent: Monday, June 4, 2012 2:17 PM
> Subject: Re: Struts2 (caching, valuestack, etc...) problem
>
> Are you watching your server console?  Are you sure it's actually making
> the request and not displaying the cached page.  If it is just showing you
> the cached page, try appending some nonsense parameter to the end of the
> URL (i.e. ?dummy=aalskdjfkal).
>
> Otherwise, you'll have to look into your action processing, you must be
> retrieving something from a cache somewhere.
>   (*Chris*)
>
> On Mon, Jun 4, 2012 at 11:09 AM, Omar Ngarigari  >wrote:
>
> > Hi All,
> >
> > I have developed an application using struts2.3.1.2, but I
> > am experiencing a weird situation that I have bumping my head for a week
> > now, but It does not go away.
> >
> > Scenario 1 - I have a query page (jsp) where I have to query database
> > based on the quarter date an input. If I entered a quarter that does not
> > have data in the database, I receive an appropriate error message saying
> > there is no record found. (That is fine!).
> >
> > Scenario 2 - On the same query page,  I entered a quarter date that has
> > record in the database, then a report is generated. (That is fine!)
> >
> > Scenario 3 - This is where I am having problem. I click on the back
> button
> > of the IE browser to navigate from the report page back to the query
> page,
> > and at the query page, I entered the same quarter date that I entered at
> > the scenario 1, I get the report that was generated on scenario2 rather
> > than error message as scenario1.
> >
> > I have searching all over the place, but not luck. I would appreciate any
> > help or clue to the problem.
> >
> > Thanks,
> >
> > Omar N.
>


Re: Struts2 (caching, valuestack, etc...) problem

2012-06-04 Thread Omar Ngarigari
I am running the application on jboss6 app server. I don't see anything on 
server console. I have debugged the app, I can see that the new input quarter 
date is returned when the request is made on the app log file. I tried your 
suggestions by adding ?something=kskdsds at the end of the url, but I got no 
record found. Can you show me how to clean a cache?



 From: Chris Pratt 
To: Struts Users Mailing List ; Omar Ngarigari 
 
Sent: Monday, June 4, 2012 2:17 PM
Subject: Re: Struts2 (caching, valuestack, etc...) problem
 
Are you watching your server console?  Are you sure it's actually making
the request and not displaying the cached page.  If it is just showing you
the cached page, try appending some nonsense parameter to the end of the
URL (i.e. ?dummy=aalskdjfkal).

Otherwise, you'll have to look into your action processing, you must be
retrieving something from a cache somewhere.
  (*Chris*)

On Mon, Jun 4, 2012 at 11:09 AM, Omar Ngarigari wrote:

> Hi All,
>
> I have developed an application using struts2.3.1.2, but I
> am experiencing a weird situation that I have bumping my head for a week
> now, but It does not go away.
>
> Scenario 1 - I have a query page (jsp) where I have to query database
> based on the quarter date an input. If I entered a quarter that does not
> have data in the database, I receive an appropriate error message saying
> there is no record found. (That is fine!).
>
> Scenario 2 - On the same query page,  I entered a quarter date that has
> record in the database, then a report is generated. (That is fine!)
>
> Scenario 3 - This is where I am having problem. I click on the back button
> of the IE browser to navigate from the report page back to the query page,
> and at the query page, I entered the same quarter date that I entered at
> the scenario 1, I get the report that was generated on scenario2 rather
> than error message as scenario1.
>
> I have searching all over the place, but not luck. I would appreciate any
> help or clue to the problem.
>
> Thanks,
>
> Omar N.

Re: Struts2 (caching, valuestack, etc...) problem

2012-06-04 Thread Chris Pratt
Are you watching your server console?  Are you sure it's actually making
the request and not displaying the cached page.  If it is just showing you
the cached page, try appending some nonsense parameter to the end of the
URL (i.e. ?dummy=aalskdjfkal).

Otherwise, you'll have to look into your action processing, you must be
retrieving something from a cache somewhere.
  (*Chris*)

On Mon, Jun 4, 2012 at 11:09 AM, Omar Ngarigari wrote:

> Hi All,
>
> I have developed an application using struts2.3.1.2, but I
> am experiencing a weird situation that I have bumping my head for a week
> now, but It does not go away.
>
> Scenario 1 - I have a query page (jsp) where I have to query database
> based on the quarter date an input. If I entered a quarter that does not
> have data in the database, I receive an appropriate error message saying
> there is no record found. (That is fine!).
>
> Scenario 2 - On the same query page,  I entered a quarter date that has
> record in the database, then a report is generated. (That is fine!)
>
> Scenario 3 - This is where I am having problem. I click on the back button
> of the IE browser to navigate from the report page back to the query page,
> and at the query page, I entered the same quarter date that I entered at
> the scenario 1, I get the report that was generated on scenario2 rather
> than error message as scenario1.
>
> I have searching all over the place, but not luck. I would appreciate any
> help or clue to the problem.
>
> Thanks,
>
> Omar N.