Re: probably a cleaner way... testing for just one user

2005-08-01 Thread Frank W. Zammetti
Fortunately, that's what list archives are for :) I see your post, I'll reply on the list shortly. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Mon, August 1, 2005 10:03 am, Tamas Szabo said: > Frank W. Zammetti wrote: > >>No problem a

Re: probably a cleaner way... testing for just one user

2005-08-01 Thread Tamas Szabo
Frank W. Zammetti wrote: No problem at all, that's what the list is for :) Woo-hoo, first subscriber (besides me)! :) Too bad there's no prize :) Oh wait, now that's embarassing... I wasn't subscribed to my own list! D'oh! To tell you the true I was afraid of this... :-DDD I thougth tha

Re: probably a cleaner way... testing for just one user

2005-08-01 Thread Frank W. Zammetti
No problem at all, that's what the list is for :) Woo-hoo, first subscriber (besides me)! :) Too bad there's no prize :) Oh wait, now that's embarassing... I wasn't subscribed to my own list! D'oh! -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnyt

Re: probably a cleaner way... testing for just one user

2005-08-01 Thread Tamas Szabo
Hi Frank and Rick, I've just subscribed to the JWP mailing list. If it's ok with you I will post messages related to this filters there... Tamas Frank W. Zammetti wrote: On Fri, July 29, 2005 12:34 am, Tamas Szabo said: Did you made the modification I suggested? I mean not continuing the

Re: probably a cleaner way... testing for just one user

2005-07-29 Thread Rick Reumann
Another option other the solution below, that might even be easier to implement... When sessionCreated is called it puts a simple flag in the ServletContext. Then in the filter that checks to see if there is a valid session, you check to see if this flag is in the Servlet context. If it is not

Re: probably a cleaner way... testing for just one user

2005-07-29 Thread Rick Reumann
Tamas Szabo wrote the following on 7/28/2005 11:56 PM: However, I would like to have a general solution for this and since we took the time to think it over we could have this code somewhere so it will be reusable in the future. Well, if we want a general solution that 'should' truly work, th

Re: probably a cleaner way... testing for just one user

2005-07-29 Thread Frank W. Zammetti
On Fri, July 29, 2005 12:34 am, Tamas Szabo said: > Did you made the modification I suggested? > I mean not continuing the chain if a sessionCount = MAX_SESSIONS. > Or you didn't find that a good idea? I haven't yet, although I agree with you that it is a good idea... the thing I'm stuggling with

Re: probably a cleaner way... testing for just one user

2005-07-28 Thread Tamas Szabo
Frank W. Zammetti wrote: Tamas Szabo wrote: For example Frank's JWP would be a great place to include these filters, if he accepted to include them in his project. I would absolutely accept them, so long as they work :) And frankly, right now I'm trying to figure out why my formerly work

Re: probably a cleaner way... testing for just one user

2005-07-28 Thread Frank W. Zammetti
Tamas Szabo wrote: For example Frank's JWP would be a great place to include these filters, if he accepted to include them in his project. I would absolutely accept them, so long as they work :) And frankly, right now I'm trying to figure out why my formerly working version of the session l

Re: probably a cleaner way... testing for just one user

2005-07-28 Thread Tamas Szabo
Hi Rick, That would probably be a good idea to use two filters vs doing it all in one. Although it could also be nice to see all that happens for each request by looking in just one filter vs two. I like this idea because in my opinion filters should do small tasks. This way they can be use

Re: probably a cleaner way... testing for just one user

2005-07-28 Thread Gonzalez Aleksander
Hello, I cannon run an application The error that I get when i asm going to run the apllication is type Status report message Servlet action is currently unavailable description The requested service (Servlet action is currently unavailable) is not currently available. It doesn{to procees my t

Re: probably a cleaner way... testing for just one user

2005-07-28 Thread Rick Reumann
Tamas Szabo wrote the following on 7/28/2005 12:51 PM: Could you clear this situation for me: User A is using the app, then his session expires. User B starts to use the app. User A comes back and want to access a page in the app. Remember that his session is expired and User B is already usi

Re: probably a cleaner way... testing for just one user

2005-07-28 Thread Tamas Szabo
Hi Rick, It's past midnight here so I'll check the code tomorrow. A few questions though... 1) For one, the business requirement created a bit more complication in the filter. For example a check for the session timing out has to take place on all pages except for (index.jsp/login/logout/app

Re: probably a cleaner way... testing for just one user

2005-07-28 Thread Tamas Szabo
Hi again, Frank W. Zammetti wrote: Yes, I think what you caught yourself is what I was driving towards :) Just for comparisons' sake, here's the filter and listener I came up with to deal with this (this is condensed for space, just showing the main bits of the puzzle)... this is what's going

Re: probably a cleaner way... testing for just one user

2005-07-28 Thread Rick Reumann
Tamas Szabo wrote the following on 7/28/2005 2:24 AM: Yes, the sessionCount is decremented everytime a session is destroyed regardless of regular logoff, 'forced' logoff (max sessions in use) :-)) or timeout. But that's what I wanted. Do you see a problem with it? sessionCount is the number of

Re: probably a cleaner way... testing for just one user

2005-07-28 Thread Frank W. Zammetti
Yes, I think what you caught yourself is what I was driving towards :) Just for comparisons' sake, here's the filter and listener I came up with to deal with this (this is condensed for space, just showing the main bits of the puzzle)... this is what's going in JWP (unless someone points out a maj

Re: probably a cleaner way... testing for just one user

2005-07-27 Thread Tamas Szabo
Hi Frank, Doesn't the sessionCount get decremented regardless of whether the session is being destroyed as the result of a regular logoff or timeout as well as if it was a rejected logon (i.e., max sessions already in use)? I dealt with this problem in the code I'm adding to Java Web Parts t

Re: probably a cleaner way... testing for just one user

2005-07-27 Thread Frank W. Zammetti
Tamas, Doesn't the sessionCount get decremented regardless of whether the session is being destroyed as the result of a regular logoff or timeout as well as if it was a rejected logon (i.e., max sessions already in use)? I dealt with this problem in the code I'm adding to Java Web Parts tomo

Re: probably a cleaner way... testing for just one user

2005-07-27 Thread Tamas Szabo
One more thing I forgot in my earlier mail. I used <[EMAIL PROTECTED] session="false" %> in appInUse.jsp Tamas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: probably a cleaner way... testing for just one user

2005-07-27 Thread Tamas Szabo
Hi Rick, Rick Reumann wrote: David G. Friedman wrote the following on 7/27/2005 12:35 AM: When a session is created, have the SessionListener update a session count. If the count is 2 or more then call SessionEvent.getSession().invalidate() to cancel the session. Then the session listener's

Re: probably a cleaner way... testing for just one user

2005-07-27 Thread Frank W. Zammetti
I solved this problem using a combination of a filter and a SessionListener... I forgot it at work unfortunately, but it will be added to Java Web Parts tomorrow. It allows you to limit the number of sessions to any specific number, and deals with the issue you mention with regard to the diffe

Re: probably a cleaner way... testing for just one user

2005-07-27 Thread Rick Reumann
David G. Friedman wrote the following on 7/27/2005 12:35 AM: When a session is created, have the SessionListener update a session count. If the count is 2 or more then call SessionEvent.getSession().invalidate() to cancel the session. Then the session listener's Session destroy method can decre

Re: probably a cleaner way... testing for just one user

2005-07-27 Thread John Henry Xu
x27;s application, his implementation is fine and he may change different pages depends on how many pages in that application. John H. Xu - Original Message - From: "John Henry Xu" To: "Struts Users Mailing List" Subject: Re: probably a cleaner way... testing for just one

RE: probably a cleaner way... testing for just one user

2005-07-27 Thread David G. Friedman
John, Well, I see our discussion varies on one key point: Rick specifically uses the word "session" for his original requirement. The ideas put forth by Tamas and myself try to limit the creation of session ID's on the server. What you seem to put forth is limiting the server to answering one web

Re: probably a cleaner way... testing for just one user

2005-07-27 Thread Dave Newton
John Henry Xu wrote: Here is Rick's original requirement, I have an odd requirement where this internal application should only be used by one valid user(one session) at a time. (The data being worked with in the application would require so many locks that's it just easier to restrict it to

Re: probably a cleaner way... testing for just one user

2005-07-27 Thread John Henry Xu
r(one session) at a time. (The data > > >> being worked with in the application would require so many locks > > >> that's it just easier to restrict it to one user). > > >> > > John H. Xu > > - Original Message - > Fr

Re: probably a cleaner way... testing for just one user

2005-07-27 Thread Tamas Szabo
Hi, Do you say that the first person who dropped connection still doing data access on data sources (and two person using data the same time)? Rick's original objective was trying to limit one person use data sources. I said that more than one session will be alive on a server. Rick said

Re: probably a cleaner way... testing for just one user

2005-07-27 Thread John Henry Xu
- Original Message - From: "Tamas Szabo" To: "Struts Users Mailing List" Subject: Re: probably a cleaner way... testing for just one user Date: Wed, 27 Jul 2005 14:08:36 +0800 > > John Henry Xu wrote: > > > Here is Rick's original re

RE: probably a cleaner way... testing for just one user

2005-07-27 Thread David G. Friedman
Thank you Tamas. I had been having a difficult time try to express to Mr. Xu the position that a session does not hold open a connection to the web server until that session ends but that a session simply refers to a set of data stored on the web server for a limited period of time between multipl

Re: probably a cleaner way... testing for just one user

2005-07-26 Thread Tamas Szabo
John Henry Xu wrote: Here is Rick's original requirement, I have an odd requirement where this internal application should only be used by one valid user(one session) at a time. (The data being worked with in the application would require so many locks that's it just easier to restrict it t

RE: probably a cleaner way... testing for just one user

2005-07-26 Thread John Henry Xu
s). Tomcats can have multiple connectors. I don't see a problem here. Again, I just try to see if configuration is possible for this interesting problem. I think Rick's coding OK also. Regards, John H. Xu - Original Message ----- From: "David G. Friedman" To: "

RE: probably a cleaner way... testing for just one user

2005-07-26 Thread David G. Friedman
months. :( -Original Message- From: Tamas Szabo [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 26, 2005 11:45 PM To: Struts Users Mailing List Subject: Re: probably a cleaner way... testing for just one user Hi, >The theory is to override the PersistentManager with your own c

RE: probably a cleaner way... testing for just one user

2005-07-26 Thread David G. Friedman
ons on various other methods plus his original Filter/sessionListeners approach. Regards, David -Original Message- From: John Henry Xu [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 26, 2005 11:52 PM To: Struts Users Mailing List Subject: RE: probably a cleaner way... testing for just one

RE: probably a cleaner way... testing for just one user

2005-07-26 Thread John Henry Xu
h it uses maxThreads as name. John H. Xu - Original Message - From: "David G. Friedman" To: "Struts Users Mailing List" Subject: RE: probably a cleaner way... testing for just one user Date: Tue, 26 Jul 2005 22:39:57 -0400 > > John, > &g

RE: probably a cleaner way... testing for just one user

2005-07-26 Thread David G. Friedman
Setting debug="99" (doubtful it does anything different over a 9) on a JSP containing the line <%= request.getSession(true).getId() %> resulted in output like this: Jul 26, 2005 11:41:28 PM org.apache.catalina.session.ManagerBase log INFO: readObject() loading session 3E8AA5B6D30D825FAD686145A

Re: probably a cleaner way... testing for just one user

2005-07-26 Thread Tamas Szabo
Hi, The theory is to override the PersistentManager with your own class. Theirs subclasses the PersistentManagerBase which subclasses ManagerBase. Now inside ManagerBase it seems to create the sessions in the method createSession(String). If you override that, you could count the sessions and if

RE: probably a cleaner way... testing for just one user

2005-07-26 Thread David G. Friedman
e creative thinker tonight -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 26, 2005 11:11 PM To: Struts Users Mailing List Subject: Re: probably a cleaner way... testing for just one user David G. Friedman wrote the following on 7/26/2005 10:39 PM: >

Re: probably a cleaner way... testing for just one user

2005-07-26 Thread Rick Reumann
David G. Friedman wrote the following on 7/26/2005 10:39 PM: John, Aren't those for simultaneous threads for the webapp, not to limit total sessions/session cookies? I thought that just mean that the jobs get queue up and run one at a time in that webapp, i.e. with fewer threads. It wouldn't

Re: probably a cleaner way... testing for just one user

2005-07-26 Thread John Henry Xu
gt; What Application server are you using? > > John H. Xu > > - Original Message - > From: "Rick Reumann" > To: "Struts Users Mailing List" > Subject: Re: probably a cleaner way... testing for just one user > Date: Tue, 26 Jul 2005 2

RE: probably a cleaner way... testing for just one user

2005-07-26 Thread David G. Friedman
given time. Regards, David -Original Message- From: John Henry Xu [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 26, 2005 10:35 PM To: Struts Users Mailing List Subject: Re: probably a cleaner way... testing for just one user Rick, In Tomcat, you can set minProcessors="1" maxPr

Re: probably a cleaner way... testing for just one user

2005-07-26 Thread John Henry Xu
" Subject: Re: probably a cleaner way... testing for just one user Date: Tue, 26 Jul 2005 22:11:38 -0400 > > John Henry Xu wrote the following on 7/26/2005 9:56 PM: > > Can you set maxprocess=1 in web application server configuration file? > > I haven't seen

Re: probably a cleaner way... testing for just one user

2005-07-26 Thread Rick Reumann
John Henry Xu wrote the following on 7/26/2005 9:56 PM: Can you set maxprocess=1 in web application server configuration file? I haven't seen that, but I would think there would/should be a way to set up "max sessions" yet googling around hasn't helped. With a combination of a filters and ses

Re: probably a cleaner way... testing for just one user

2005-07-26 Thread John Henry Xu
Can you set maxprocess=1 in web application server configuration file? John H. Xu http://www.usanalyst.com http://www.GetusJobs.com (The largest free job portal in North America) - Original Message - From: "Rick Reumann" To: "Struts Users Mailing List" Subject: probably a

Re: probably a cleaner way... testing for just one user

2005-07-26 Thread Liming Xu
Could we use a static variable to solve the problem? - Original Message - From: "Rick Reumann" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Tuesday, July 26, 2005 6:06 PM Subject: probably a cleaner way... testing for just one user I have an odd requirement where this i

Re: probably a cleaner way... testing for just one user

2005-07-26 Thread Rick Reumann
A cleaner way I'm finding is to compare the sessionID with one that I put in application scope. Much better than the flag garbage below. Rick Reumann wrote the following on 7/26/2005 5:06 PM: I have an odd requirement where this internal application should only be used by one valid user(one ses