You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Todd O'Bryan <to...@mac.com> on 2004/03/22 02:17:04 UTC

new Visit object created for no good reason

Here is the course of events when I try to use my webapp (which has 
about 6 pages):

I go to the Login page and type in a username and password.
As verified by a println in the pageValidate method in a ProtectedPage 
class that all my pages requiring validation extend, a Visit object 
with the user I had typed is created and I go to the MainMenu page.
I click on any menu item and the Visit (printed by the same println) 
has changed, there is no user set, and I'm redirected to my login page 
as should happen when the user has failed to log in.
I try re-logging in, and I get this error message:
------------------
  Your session has timed out.

  Web applications store information about what you are doing on the 
server. This information is called the session.

  Web servers must track many, many sessions. If you are inactive for a 
long enough time (usually, a few minutes), this information is 
discarded to make room for active users.

  At this point you may restart the session to continue.
-------------------
I can restart, but the whole process repeats itself. I log in, try to 
do anything, go back to the login page, and if I try to re-log in, it 
tells me the session has timed out.

Strangely enough, everything was basically working before, but I could 
have screwed something up without realizing it.

Does anyone have any idea what could be causing the wanton creation of 
new, unnecessary Visits, or failing that, an idea of how to figure out 
where they're being created?

Thanks,
Todd

  


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


Re: new Visit object created for no good reason

Posted by Todd O'Bryan <to...@mac.com>.
I have three links in the MainMenu page, all of which are generic 
@PageLinks to a CreateUser, ChangePassword, and Logout page.

If a user isn't logged in, I throw a PageRedirectException to send 
him/her to the Login page.

I'll subclass BaseEngine and see where it's happening...

Thanks,
Todd

On Mar 22, 2004, at 4:26 AM, Petter Måhlén wrote:

>>> Does anyone have any idea what could be causing the wanton
>> creation of
>>> new, unnecessary Visits, or failing that, an idea of how to
>> figure out
>>> where they're being created?
>
> Try sub-classing BaseEngine with a class that has a method like this:
>
>   protected Object createVisit(IRequestCycle cycle) {
>     Object visit = super.createVisit(cycle);
>
>     logger.debug("got a visit of class: " + visit.getClass());
>
>     return visit;
>   }
>
> That should give you some idea at least. But it's really quite weird 
> that
> new visits keep getting created. How do you do page redirection from 
> the
> login page? What kind of links have you got in the main menu and how 
> do you
> redirect the user to the next page?
>
> / Petter
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


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


RE: new Visit object created for no good reason

Posted by Mind Bridge <mi...@yahoo.com>.
You can also create an Exception in here and print it out -- you'll get a
stack trace that gives you fairly good idea of what is going on:

(new Exception()).printStackTrace();

-----Original Message-----
From: Petter Måhlén [mailto:petter.mahlen@elevance.se]
Sent: Monday, March 22, 2004 11:27 AM
To: 'Tapestry users'
Subject: RE: new Visit object created for no good reason


> > Does anyone have any idea what could be causing the wanton
> creation of
> > new, unnecessary Visits, or failing that, an idea of how to
> figure out
> > where they're being created?

Try sub-classing BaseEngine with a class that has a method like this:

  protected Object createVisit(IRequestCycle cycle) {
    Object visit = super.createVisit(cycle);

    logger.debug("got a visit of class: " + visit.getClass());

    return visit;
  }

That should give you some idea at least. But it's really quite weird that
new visits keep getting created. How do you do page redirection from the
login page? What kind of links have you got in the main menu and how do you
redirect the user to the next page?

/ Petter


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


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


RE: new Visit object created for no good reason

Posted by Petter Måhlén <pe...@elevance.se>.
> > Does anyone have any idea what could be causing the wanton 
> creation of 
> > new, unnecessary Visits, or failing that, an idea of how to 
> figure out 
> > where they're being created?

Try sub-classing BaseEngine with a class that has a method like this:

  protected Object createVisit(IRequestCycle cycle) {
    Object visit = super.createVisit(cycle);
    
    logger.debug("got a visit of class: " + visit.getClass());
    
    return visit;
  }

That should give you some idea at least. But it's really quite weird that
new visits keep getting created. How do you do page redirection from the
login page? What kind of links have you got in the main menu and how do you
redirect the user to the next page?

/ Petter


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


Re: new Visit object created for no good reason

Posted by Todd O'Bryan <to...@mac.com>.
I should have said: Tapestry 3.0 (both beta4 and rc1 exhibit the 
problem) running on Tomcat 4.1.30.

On Mar 21, 2004, at 8:17 PM, Todd O'Bryan wrote:

> Here is the course of events when I try to use my webapp (which has 
> about 6 pages):
>
> I go to the Login page and type in a username and password.
> As verified by a println in the pageValidate method in a ProtectedPage 
> class that all my pages requiring validation extend, a Visit object 
> with the user I had typed is created and I go to the MainMenu page.
> I click on any menu item and the Visit (printed by the same println) 
> has changed, there is no user set, and I'm redirected to my login page 
> as should happen when the user has failed to log in.
> I try re-logging in, and I get this error message:
> ------------------
>  Your session has timed out.
>
>  Web applications store information about what you are doing on the 
> server. This information is called the session.
>
>  Web servers must track many, many sessions. If you are inactive for a 
> long enough time (usually, a few minutes), this information is 
> discarded to make room for active users.
>
>  At this point you may restart the session to continue.
> -------------------
> I can restart, but the whole process repeats itself. I log in, try to 
> do anything, go back to the login page, and if I try to re-log in, it 
> tells me the session has timed out.
>
> Strangely enough, everything was basically working before, but I could 
> have screwed something up without realizing it.
>
> Does anyone have any idea what could be causing the wanton creation of 
> new, unnecessary Visits, or failing that, an idea of how to figure out 
> where they're being created?
>
> Thanks,
> Todd
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


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