RE: switch statement

2003-06-06 Thread Miller, Jason
You can use a HashMap, keyed by the parameter, with the value being the
appropriate forward

Then you just do something like

return (ActionForward)forwardMap.get( parameter );

This avoids the if..else blocks, and makes the code a lot cleaner to read.

> -Original Message-
> From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 05, 2003 11:42 AM
> To: 'Struts Users Mailing List'
> Subject: RE: switch statement
> 
> 
> The reason I wanted to do this was to make my Action classes 
> cleaner.  I
> send a parameter to the Action to determine which item to pull from a
> database, then forward to a certain page.
> 
> I didn't think I could get the switch to work, it was worth a 
> try though.
> For a situation like mine, what do you all find to be the 
> best way of doing
> this?  I know I can use a series of if statements, it's just not very
> pretty...
> 
> 
> Keith Kamholz
> Programming and Architecture
> Moog Inc.
> 
> Phone: (716) 687-7001
> 
> 
> 
> -Original Message-
> From: Erik Price [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 05, 2003 11:38 AM
> To: Struts Users Mailing List
> Subject: Re: switch statement
> 
> 
> 
> 
> Kamholz, Keith (corp-staff) USX wrote:
> > Hey everyone,
> > This is more of a Java question than a Struts question, I 
> hope you all
> don't
> > mind.
> 
> Not really, but for future reference I have found this resource to be 
> more helpful for such questions:
> 
> http://forum.java.sun.com/forum.jsp?forum=31
> 
> > I'm just wondering if there is any way to use a String for a switch
> > statement, or if you are restricted to the true primitive types.
> > I haven't found a way, but it seems like something that 
> lots of people
> would
> > want that wouldn't be hard for the Java developers to allow for.
> > Wouldn't you agree?
> 
> The reason why it doesn't work is probably specific to the 
> implementation of the language (maybe performance reasons), 
> but a lot of 
> people don't miss it -- nor would they agree, I suspect.  The 
> reason is 
> that you can usually add behaviors to objects so that a single 
> polymorphic method call can usually eliminate all of the 
> infrastructural 
> work of writing a switch statement, so doing a switch on an object 
> doens't make much sense in that context.  Of course, this is not 
> applicable in all senses, such as your case with String which 
> is final
> 
> 
> 
> 
> 
> Erik
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


RE: ArrayList & Object[] funkiness

2003-03-12 Thread Miller, Jason
In almost every situation, I place the Iterator from the collection, or
something I construct using o.a.commons.collections.IteratorUtils, into the
form.  This way, I am not tied to any particular backing representation.
I'm not sure if this is the correct way to go, but it has served me well to
this point.

> -Original Message-
> From: Rick Reumann [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 12, 2003 4:33 PM
> To: Struts Users Mailing List
> Subject: Re: ArrayList & Object[] funkiness
> 
> 
> On Wed, 12 Mar 2003 16:25:08 -0500
> "Mark Galbreath" <[EMAIL PROTECTED]> wrote:
> 
> > ArrayList; if you return Object[] you will have to cast it into an
> > ArrayList.
> 
> I know you know this Mark, but just to be a bit more 
> technically correct
> in case [EMAIL PROTECTED] isn't aware, any of the 
> Collection classes
> including the base class Collection should work I believe with iterate
> (it doesn't have to be just type ArrayList... although I find myself
> using that one the most often).
> 
> 
> -- 
> Rick Reumann
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


RE: [OT] Clearing up a misconception - was ActionForm Does Not Contain Dynamically Set Data

2003-03-04 Thread Miller, Jason
> Yes, a query parameter is an option. The reason I
> don't want to use query parameters is we have a
> standard to avoid using them if at all possible as
> they expose data to the user. This particular piece of
> data in question doesn't present a security risk by
> being exposed, but exposing it does go against our
> standards so I'd like to find another way to pass it.

I would just like to point out to anyone reading this list that the
technique mentioned above, "Security Through Obscurity," is totally invalid.
Do not believe that simply because you are not explicitly displaying
information in a browser to a user directly that you have done something
that mitigates any security risks.  A knowledgeable, lucky, or well-read
user can find out anything the client is doing.

I would just like to see people understand that whether you post or get, the
information you submit is easily viewable by your users.  I had to spend two
hours explaining to one of my companies "developers" that just because he
posted the user login instead of getting it, he was not providing adequate
protection for the password.

That is all.


RE: [OT]JavaScript: ActionForm Does Not Contain Dynamically Set Data

2003-03-04 Thread Miller, Jason
Is it necessary that the child window displays a location bar?  Seems to me
that if you are opening the window using javascript, you can certainly turn
off the various features you won't need anyway.  The way you describe this
it sounds like a dialog box, so it seems to me the simplest response is the
best - querystring it man.   you know you want to.

> -Original Message-
> From: Art Vandalay [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 04, 2003 12:14 PM
> To: Struts Users Mailing List
> Subject: RE: ActionForm Does Not Contain Dynamically Set Data
> 
> 
> Yes, a query parameter is an option. The reason I
> don't want to use query parameters is we have a
> standard to avoid using them if at all possible as
> they expose data to the user. This particular piece of
> data in question doesn't present a security risk by
> being exposed, but exposing it does go against our
> standards so I'd like to find another way to pass it.
> 
> --- "Miller, Jason" <[EMAIL PROTECTED]> wrote:
> > Are you saying that you open the window, then set a
> > field value in that
> > child window to something from the parent, and you
> > want to use that value to
> > do something on the server?  why not pass the value
> > as a querystring
> > parameter?
> > 
> > > -Original Message-
> > > From: Art Vandalay
> > [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, March 04, 2003 11:59 AM
> > > To: Struts Mailing List
> > > Subject: ActionForm Does Not Contain Dynamically
> > Set Data
> > > 
> > > 
> > > I have a web page (the "parent") that opens a
> > child
> > > window using javascript. The parent window sets a
> > > field on the child window. The child window needs
> > to
> > > use that data, as it is opening, to perform a DB
> > query
> > > and display information on itself.
> > > 
> > > The problem is that, even though the parent
> > > successfully sets the data on the child, I have no
> > > access to it in my ActionForm or in the request
> > > object.
> > > 
> > > Is there a way to make that happen?
> > > 
> > > 
> > > 
> > > __
> > > Do you Yahoo!?
> > > Yahoo! Tax Center - forms, calculators, tips, more
> > > http://taxes.yahoo.com/
> > > 
> > >
> >
> -
> > > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > > 
> > 
> 
> 
> __
> Do you Yahoo!?
> Yahoo! Tax Center - forms, calculators, tips, more
> http://taxes.yahoo.com/
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


RE: ActionForm Does Not Contain Dynamically Set Data

2003-03-04 Thread Miller, Jason
Are you saying that you open the window, then set a field value in that
child window to something from the parent, and you want to use that value to
do something on the server?  why not pass the value as a querystring
parameter?

> -Original Message-
> From: Art Vandalay [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 04, 2003 11:59 AM
> To: Struts Mailing List
> Subject: ActionForm Does Not Contain Dynamically Set Data
> 
> 
> I have a web page (the "parent") that opens a child
> window using javascript. The parent window sets a
> field on the child window. The child window needs to
> use that data, as it is opening, to perform a DB query
> and display information on itself.
> 
> The problem is that, even though the parent
> successfully sets the data on the child, I have no
> access to it in my ActionForm or in the request
> object.
> 
> Is there a way to make that happen?
> 
> 
> 
> __
> Do you Yahoo!?
> Yahoo! Tax Center - forms, calculators, tips, more
> http://taxes.yahoo.com/
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


RE: Rendering in XHTML

2003-03-03 Thread Miller, Jason
One other thing I forgot - the XML declaration also caused it to choke.  

>Hello,
>
>I'm having problems getting my browser to render the XHTML properly.  My
>doctype is correct, and my page is well formed.  For some reason, when I 
>hit
>the page, the DOM is shown in IE 6.0.  I'm running Struts 1.1 on Weblogic
>7.0.
>
>Thanks in advance!
>
>-Josh


RE: Rendering in XHTML

2003-03-03 Thread Miller, Jason
I had a problem like that when I tried to name my file to something like
.xhtml or .xml and serve it as an XHTML document. IE decided that rendering
it would be too much trouble.  I experimentally determined either the
resource must have a .htm or .html extension, regardless of doctype, or the
mime type had to be text/html.  Not exactly the solution I was hoping for,
but about the best I can personnally offer.  Hopefully someone has a better
answer.


>Hello,
>
>I'm having problems getting my browser to render the XHTML properly.  My
>doctype is correct, and my page is well formed.  For some reason, when I 
>hit
>the page, the DOM is shown in IE 6.0.  I'm running Struts 1.1 on Weblogic
>7.0.
>
>Thanks in advance!
>
>-Josh


RE: [OT] DBCP Pool Closed connection problem

2003-02-27 Thread Miller, Jason
I had this problem once.  At the time, I was positive everything was closed
correctly, but it turned out at one point, where I was unwrapping the
connection, I had closed it.  This inadvertently caused the pool to be
exhausted.

This occurred before I had a quality check on my connections, so it didn't
replace the closed ones.  Still, check exhaustively before you say you are
positive all closings are correct.

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 3:52 PM
> To: [EMAIL PROTECTED]
> Subject: [OT] DBCP Pool Closed connection problem
> 
> 
> Hi,
>   I'm using commons DBCP in conjuction with STRUTS.
>   When a lot of users start using  our application, we 
> start getting a
> lot of exceptions related to Connections, like "Exhausted 
> Resultset" or
> "Connection is Closed". The first one happens when we try to 
> retrieve a
> column from a resultset. The second one happens when we try to open a
> connection.
>   Neither of these errors happen in a predictable fashion.
>   Right now we have set the pool max active connections 
> to 50 and the
> number of users testing is about 5.
>   I'm absolutely positive, that all connections, resultsets and
> statements have been closed at the appropriate places by the pool. 
>   Is it a problem with the way I've configured the pool? 
> has anyone
> faced a similar problem before?
> 
> Thanks,
> Gaurav
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


RE: [OT] dick size

2003-02-20 Thread Miller, Jason
someone scored under a 100, huh?

> -Original Message-
> From: alexj [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 20, 2003 2:35 PM
> To: Struts Users Mailing List
> Subject: [OT] dick size
> 
> 
> After your IQ test why not try the dick size test ? 
> 
> Tell us your dick size you will maybe win a decicated
> email who claim you are the most stupid guy ever seen.
> 
> Good luck.
> 
> <--
> Alexandre Jaquet
> ->
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



RE: Conditional forms

2003-02-06 Thread Miller, Jason
would it work to just leave the form tag in there at all times and simply be
conditional regarding the fields?  The empty form shouldn't cause any
problems that I can see.

> -Original Message-
> From: Justin Ashworth [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 06, 2003 4:19 PM
> To: [EMAIL PROTECTED]
> Subject: Conditional forms
> 
> 
> Hi all,
> 
> Using Struts, is there a slick way of creating a form based 
> on some condition?  I have a generic JSP to display a certain 
> type of data, and this data may in some cases contain form 
> fields.  In those cases I need to enclose the form fields 
> within a  tag.  However, I haven't found a way of doing 
> this that's parseable.  If the  tag had a 
> "test" condition, this would work great.  Has anybody run 
> into this and found a fix?
> 
> Here is essentially what I'm trying to do (although this 
> obviously doesn't work)...
> 
> 
>
> 
> 
> 
> 
> 
>
> 
> 
> Thanks,
> 
> Justin
> 



RE: Value of Struts?

2003-01-22 Thread Miller, Jason
There's also the indirect value of the components struts has conjured into
being - the digester, the collections, the beanutils, and so on.  These have
made my life easier for a number of tasks.

> -Original Message-
> From: Gene Campbell [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 22, 2003 6:07 PM
> To: [EMAIL PROTECTED]
> Subject: Value of Struts?
> 
> 
> I've been using Struts ...
> something something something
> I'm just having a hard time figuring out why
> Struts is so popular.  
> 
> thanks - gene



RE: getter doesn't work in scriplet

2003-01-20 Thread Miller, Jason
One idea - you don't seem to be casting the bean to the specific type.
Therefore, reflection would work, but a static call would not.

> Hi
> 
> I am using getter in jsp but it throws no such method found 
> exception, but 
> the same property gets displayed when I use  
> So
> 
> 
>   
> 
> 
> works
> 
> but
> 
> 
>   <% String name = field.getName(); %>
> 
> 
> doesn't.  Any ideas
> 
> Thanks
> Rajiv



RE: Nested html:form

2002-10-25 Thread Miller, Jason
So you have two forms, and when one is submitted you want to include every
element from both forms, and when the other is submitted, you want only the
specific elements included?  I think you will have to do some funky server
manipulation to pull off this trick.  Basically, it looks like you'll have
to treat the whole thing as one big form, and then check which button was
used to submit, then ignore (or include) the appropriate subset of formbean
properties in your processing.

If you can get the nested forms bit to work, then neato.

> I want all the elements of the inside form to get submitted with the
> request, but not vice versa.  Also, I want to seperate forms.



RE: Nested html:form

2002-10-25 Thread Miller, Jason
I could be wrong, but I don't think it's legal to nest forms.  I'm fairly
sure that the  element in HTML cannot have a nested  element.
In any case, it seems like a pretty obfuscated thing to do.  What are you
hoping to accomplish?


> What's the best way to nest forms?
> 
> I want to:
> 
> 
>   
>   
>   
>   
> 
> 
> But, when I try this, src B always invokes action A -- I want src B to
> invoke action B.
> 
> Any help is greatly appreciated.
> 
> Thanks,
> 
> --Mike



RE: Zero-copy persistence with Struts?

2002-10-23 Thread Miller, Jason
I do something similar to what you are proposing, so far as the
ResultSet-to-the-view bit goes.  I have a wrapper class that adapts an
Iterator interface to anything you need.

So far as closing the resources go, I ended up coding in a requirement that
the ResultSet only contain the data that is to be displayed.  This isn't as
much of a problem as one would think, since normally, its a waste of time to
get 1000 rows from a database when only 50 are being displayed anyway.  It
would also be trivial to extend the class to configure it to display X
number of rows and then close.

The wrapper is not specific to ResultSets - it can wrap any source of data
so long as a subclass is defined to transform the data.

I can send you what I have, if you are interested, or post it somehow.  At
least it may give you a starting point, and it will certainly explain what I
mean better than I have done here.

Jason

> -Original Message-
> From: Bryan Field-Elliot [mailto:bryan_lists@;netmeme.org]
> Sent: Tuesday, October 22, 2002 10:36 PM
> To: Struts Users Mailing List
> Subject: Zero-copy persistence with Struts?
> 
> 
> I'm banging my brain against the sides of my skull trying to 
> think of a
> way to do zero-copy JDBC persistence with Struts.
> 
> What I mean by zero-copy is, basically, pass as much "raw data" as
> possible between the Model layer and the View layer. In 
> pragmatic terms,
> this probably means taking a JDBC ResultSet in the Model layer,
> decorating it somehow (e.g. wrapping it in a DynaBean, or otherwise),
> and setting it into the Request attribute context, where the JSP page
> can iterate through and display it.
> 
> Why bother? Performance.
> 
> So here's the catch... if I insert the ResultSet into the request
> context, then somewhere later I need to close the ResultSet, and
> probably also the Statement which produced it and possibly even the
> Connection which was queried in the first place. It wouldn't 
> make sense
> from a design standpoint to put this plumbing in each JSP page.
> 
> My thinking is to build a Filter (Servlet 2.3) which, after all Model
> and View classes are called (e.g. Struts actions and JSP pages), close
> all the ResultSets, Statements, etc. This seems a little complex but
> it's the best pattern I can come up with. I was hoping for 
> some (expert)
> opinions on this approach.
> 
> The basic flow would be:
> 
> 1. Struts Action does the following:
>1a. grabs a connection from the pool
>1b. create a Statement (or PreparedStatement), do the JDBC work,
> obtain a ResultSet
>1c. Decorate the ResultSet as needed (e.g. wrap it inside a
> ResultSetDynaClass)
>1d. Push the original Connection, Statement, and ResultSet onto a
> request context "stack" of some kind (with an agreed-upon key name).
> 2. JSP page does the following:
>2a. Iterate through the ResultSet (or it's wrapper) as if it were a
> standard collection of standard beans.
> 3. Filter does the following cleanup:
>3a. Retrieve the "stack" of open JDBC primitives from the request
> context.
>3b. Close them all.
> 
> This seems to achieve a nice level of zero-copyness without bothering
> the JSP page with messy plumbing details. Comments?
> 
> Thanks,
> Bryan
> 



RE: Request v Page scope?

2002-10-15 Thread Miller, Jason


I never knew professional baseball players were interested in web
applications.

> That would explain why I thought it was funny ... being a 
> British chap myself and all that. (Never appologise for your 
> British humour, these yankees don't have any humour of their 
> own, so they should be grateful that we share any of ours 
> with them! ;-)
> 
> Simon



RE: javascript help

2002-10-10 Thread Miller, Jason

you have to add a  immediately after the opening tag.

also, some browsers will only run a script if the mime type is one they
recognize.  try renaming your script file to formscripts.js.

as to the script itself, i don't see anything wrong with it, but I haven't
yet manipulated form elements through the DOM api yet.

Jason

> -Original Message-
> From: kiuma [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 10, 2002 11:43 AM
> To: Struts Users Mailing List
> Subject: javascript help
> 
> 
> The previous problem was on 

RE: Struts ActionMapping / OC4J problem

2002-09-27 Thread Miller, Jason

Maybe a stupid question, but I guess it never hurts to check.  Is the
servlet properly mapped, and are you using the correct pattern to call the
URL?

For kicks, mark the second action as your unknown action and then send some
random request ( e.g. "blah.do" ) and see what happens there.

> -Original Message-
> From: Thomas Delnoij [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 27, 2002 8:43 AM
> To: [EMAIL PROTECTED]
> Subject: Struts ActionMapping / OC4J problem
> 
> 
> Dear colleagues,
> 
> I have a problem configuring Struts to run properly with the 
> embedded OC4J
> app server in Oracle 9i JDeveloper.
> 
> It can only find the first Action Object of these two ActionMappings I
> configured.
> 
> 
>  name="TrekkerFormBean" scope="request"
> input="/trekker/keuringsformulier.jsp" validate="true">
>   
>   
> 
> 
>   
>path="/veldspuit/keuringsformulier.jsp"/>
>path="/boomgaardspuit/keuringsformulier.jsp"/>
> 
>   
> 
> The first ActionMapping accepts input from a form. The second 
> is mapped to a
> "normal" link:
> 
> The Action Objects are in the same directory.
> 
> I worked with Struts before in the Resin container. I think I 
> am missing out
> on some JDeveloper specific config options.
> 
> I look forward to your suggestions.
> 
> Kind regards.
> 
> Thomas Delnoij
> Internet Engineer
> IMN - SSE Baarn
> 
> Mobile: +31 6 144 300 14
> EMail: [EMAIL PROTECTED]
> 
> 
> --
> To unsubscribe, e-mail:   
> 
> For additional commands, e-mail: 
> 
> 



RE: [FRIDAY] [OT] Best misunderstanding of an acronym?

2002-09-27 Thread Miller, Jason

so your mileage varied?  hah aha ha ha  uh *cough cough*

> -Original Message-
> From: Andrew Hill [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 27, 2002 11:06 AM
> To: Struts Users Mailing List
> Subject: RE: [FRIDAY] [OT] Best misunderstanding of an acronym?
> 
> 
> Ah!
> No wonder I didnt recognise it.
> We use kilometres here.
> 
> -Original Message-
> From: Kevin A. Smith [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 27, 2002 23:01
> To: Struts Users Mailing List
> Subject: RE: [FRIDAY] [OT] Best misunderstanding of an acronym?
> 
> 
> I think it stands for Your Mileage May Vary.
> 
> AFAIK ;)
> 
> -Original Message-
> From: Andrew Hill [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 27, 2002 10:56 AM
> To: Struts Users Mailing List
> Subject: RE: [FRIDAY] [OT] Best misunderstanding of an acronym?
> 
> 
> ummm.. So what does it actually mean?
> 
> -Original Message-
> From: Peter S. Hamlen [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 27, 2002 22:51
> To: Struts Users Mailing List
> Subject: [FRIDAY] [OT] Best misunderstanding of an acronym?
> 
> 
> Yesterday, I sent an email to a co-worker on a topic, and added at the
> bottom YMMV without bothering to explain the acronym.
> 
> This morning (about ten minutes ago), she showed up and asked:
> "What does YMMV mean? You Make Me Vomit? "
> 
> Anyone else have any choice examples of misunderstood acronyms?
> 
> -Peter
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> 
> --
> To unsubscribe, e-mail:   

For additional commands, e-mail:




RE: The right place/time to clean up a session before session tim e out, or user logoff

2002-09-25 Thread Miller, Jason

I think I may have been a little unclear in my explanation.

I have a system of object for security checking.  The only object that is
used in the web part of my application
is a proxy to my User objects.  This proxy also implements the
HttpSessionBindingListener interface.  In the
valueUnbound() method, I call to my logic bean that handles the logout
actions with a reference to the proxied object.
This is the only place I call the logout logic from with the web portion of
the application.

The (struts based) LogoutAction I created does nothing but invalidate the
session.  This causes the valueUnbound method to
be called.  This chains to the logout logic.

When the session times out on its own, the valueUnbound method is also
called, hence, the logout logic again is called.

Sorry if I didn't explain that clearly before.


_
Jason,

Your solution covers the log off case. How about session time out, say, a
user leave a page of the application and 
browse another site. There isn't log off action in this case. 



RE: RE: The right place/time to clean up a session before session tim e out, or user logoff

2002-09-23 Thread Miller, Jason

What do you have stored in the session that has to be checked on?

I only need the reference to my UserProxy object, so I call the logoff
method like so:

Security.doUserLogoff( this );

if you need other things that are in the session, is it feasible to keep
them elsewhere and key
them by whatever object you are implementing the listener with?  Or can you
make them all listen?
that seems unwieldy, though.

___
I have tried something similar with yours: a object stored in the session
and with a HttpSessionBindingListener 
implementation. When the invalidate method is called in the logoff action,
it is too late for the valueUnbound method to 
retrieve anything from the session since it is invalid already.

9/23/2002 2:56:58 PM, "Miller, Jason" <[EMAIL PROTECTED]> wrote:





--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>



RE: The right place/time to clean up a session before session time out, or user logoff

2002-09-23 Thread Miller, Jason

I have a object representing a user that acts as a proxy into my
security framework that implements HttpSessionBindingListener, 
and the valueUnbound method calls my logout logic, which includes
removing the user from the set of currently logged in users, as well as
DB updates and some other little things.

The user's explicit logout action just has to invalidate the session in
this scenario.

HTH 
Jason

___


In order to keep track of who is online, I need to keep a list of on line
users. When a user sign in, which can have more 
than one routes, an account information object is created. The class
implements the HttpSessionBindingListener 
interface. The user id is added into the list in the valueBound method. 

I would like to have a single one place to remove the user id from the list
when user sign out, or session time out. The 
valueUnbound method is not a good place since the session is invalidated
already when the invalidate method is 
called. The sessionDestroyed method of the HttpSessionListener interface
isn't a right place neither.

Any suggestions?