Re: Paged search results
Thank you to everyone for your insights and suggestions towards solving this problem. I *greatly* appreciate it. I learnt lots from doing small amounts of research into some of the suggestions, this was fantastic. We have decided to go with the chore of url re-writing for simplicity and in order to keep away from sessions altogether. Plus this approach would also allow people to cut and paste the URL into browsers or email them to friends etc..Again, thank you for the responses to my question Regards, -- Holden Glova, [EMAIL PROTECTED] Software Engineer Alchemy Group Limited Level 6 Royal Sun Alliance Bldg PO Box 2386 Christchurch New Zealand Phone: +64 3 962-0382 Fax: +64 3 962-0388
RE: Paged search results
With all browsers, session cookies are usually shared within a OS process The default IE behavior is to share the process whenver new windows are opened with CTRL-N. If you execute a shortcut to IE, it will open a window attached to a different process. Netscape 4.x in both Windows and Linux always runs different windows within the same process. Changing this behavior needs a rebuild in Linux. I don't know how Netscape 6 behaves. Opera is a MDI application, and also, session cookies are always shared within an Opera instance. Corollary: If a user logs off in a browser window, he'll be logged off in (practically) every other browser window. P.S. : this stands only for FORM based auth. Basic Auth is sent by the browser as needed and doesn't require http session capabilities on the server side. > -Original Message- > From: Trevor Squires [mailto:[EMAIL PROTECTED]] > Sent: Thursday, March 29, 2001 12:49 PM > To: Orion-Interest > Subject: Re: Paged search results > > > On Wed, 28 Mar 2001, Gary Shea wrote: > > > It seems to me that if you have multiple browsers open and they're > > sharing an application like Netscape does, they will all have the > > same session unless you're using URL rewriting. My experience with > > Netscape and Konqueror (sorry I don't know anything about IE) is > > that once a cookie is established on any one browser, all the rest > > will begin submitting it. As a result, if you're using cookie-based > > sessions, then your browsers are all in the same session. If you're > > using URL rewriting they'll all have independent sessions. > > In IE (perhaps only on NT, dunno) you can configure it so > that all browser > windows are in a separate process space. This means that > non-persistent > cookies are *not* shared between windows AFAIK. > > Trevor > > > >
Re: Paged search results
On Wed, 28 Mar 2001, Gary Shea wrote: > It seems to me that if you have multiple browsers open and they're > sharing an application like Netscape does, they will all have the > same session unless you're using URL rewriting. My experience with > Netscape and Konqueror (sorry I don't know anything about IE) is > that once a cookie is established on any one browser, all the rest > will begin submitting it. As a result, if you're using cookie-based > sessions, then your browsers are all in the same session. If you're > using URL rewriting they'll all have independent sessions. In IE (perhaps only on NT, dunno) you can configure it so that all browser windows are in a separate process space. This means that non-persistent cookies are *not* shared between windows AFAIK. Trevor
Re: Paged search results
This may be an even simplier solution: Check out the PagerTag at JspTags.com. It provides a taglib to page through a collection of results (a la Google). Currently, the implementation requires using raw SQL in your session (since it requires the ability to scroll through a ResultSet, though I assume the full implementation of the EJB 2.0 spec), but it does provide a fairly clean solution to your problem. brian
Re: Paged search results
En la fecha Thu, Mar 29, 2001 at 09:45:21AM +1200, Holden Glova escribio: > I guess my confusion comes into a lack > of terminology and understanding of how > to approach this problem. What we would > like to do is be able to perform a > search on the DB, but only show the user > 10 of the results at a time. Initially > we have thought that sessions might be > the key to this, but then wondered what > would happen if the user had more than > one browser window open, clearly they > would be clobbering each others cached > search results, no? Hi, well I think that you can use many ways to approach your objetive. One can be: Use a DB that allows "limit", and move forward and backwards with this function (I tested it in mySQL and it works great!), as you can tell "from", and "how many" results to show... It's quite easy... Another way can be using a Session Bean, controlling all the searches, and then you can use a Collection, List, everything you want. The SessionBean has to be Stateful for using it in many searches; you can regroup by "search" words, so you can have one Collection for each search, and paginate in each, individually... > > So we have also thought about perhaps > using another table to store the results > from each search performed associated > with each browser window through > attempting to add a unique value to a > query string which will also be the PK > in the table of search results. This way > we can move the current record pointer > forward and backwards at will and allow > for people having more than one browser > window open while doing searches. > Are you talking about BMP or CMP? > Do these concerns/strategies sound sane? > If not, maybe it is a reflection of my > own state of mind (i.e. insane :) I don't know... I'm a beginner... :) Sorry for my english, if you need a "Luar to english" traductor, just tell me! (Luar it's my name, not an extrange language :) Well, see ya! Luar Rojí CompuService S.R.L. Montevideo - Uruguay
Re: Paged search results
On Tomorrow, Holden Glova ([EMAIL PROTECTED]) wrote: > Hmm..just want to clarify I understand > exactly what you are saying here. If I > have 2 or more browser windows open then > each will be associated with a separate > session? Perhaps I worded it wrong > previously. It seems to me that if you have multiple browsers open and they're sharing an application like Netscape does, they will all have the same session unless you're using URL rewriting. My experience with Netscape and Konqueror (sorry I don't know anything about IE) is that once a cookie is established on any one browser, all the rest will begin submitting it. As a result, if you're using cookie-based sessions, then your browsers are all in the same session. If you're using URL rewriting they'll all have independent sessions. I'm watching this with Netscape at schwab.com right now -- I'm using Netscape, and all my browsers are clearly in the same session -- I don't have to log in when I open a new browser. Which is why I'm so happy that Orion URL rewriting works very nicely ;) Gary > Johan Fredriksson wrote: > > For multibrowser usage, there will be separate sessions for those. There is > > probably a way to get them to use the same session, but I haven't tried > > this. In this case I suggest a hashtable in the application object and an id > > string ( key in hashtable ) in the session. > > > > Hope this at least gives you a couple of ideas on how to get started. > > > > regards > > > > Johan > > - Original Message - > > From: "Holden Glova" <[EMAIL PROTECTED]> > > To: "Orion-Interest" <[EMAIL PROTECTED]> > > Sent: Wednesday, March 28, 2001 6:19 AM > > Subject: Paged search results > > > > > Hi all, > > > > > > Perhaps this is slightly off topic and > > > if so, I apologize and feel free to > > > ignore this. My knowledge of j2ee is not > > > high but I would like to know the best > > > way to handle this with of course, > > > minimal complexity. I am not sure where > > > else I can find information on this > > > subject from knowledgeable people > > > though, so here goes. > > > > > > We are wondering what the best approach > > > would be move through a collection of > > > page results that come back from a > > > search. We have thought about using > > > sessions to cache the results and help > > > keep track of what the current result > > > view consists of, but we are not sure if > > > this is the best way to handle something > > > like this. Some things that come to mind > > > are what would happen if we have > > > multiple browsers open trying to perform > > > different searches at the same time, > > > would we need a separate SessionBean to > > > cache these results in? > > > > > > What could be some of the advantages and > > > disadvantages of using sessions for this > > > problem? Can anyone point me to some > > > other ways of approaching this problem > > > aside from using sessions? > > > > > > Thanks in advance for any help and > > > pointers that are given. > > > > > > Regards, > > > > > > -- > > > Holden Glova, [EMAIL PROTECTED] > > > Software Engineer > > > Alchemy Group Limited > > > Level 6 Royal Sun Alliance Bldg > > > PO Box 2386 > > > Christchurch > > > New Zealand > > > Phone: +64 3 962-0382 > > > Fax: +64 3 962-0388 > > > -- > Holden Glova, [EMAIL PROTECTED] > Software Engineer > Alchemy Group Limited > Level 6 Royal Sun Alliance Bldg > PO Box 2386 > Christchurch > New Zealand > Phone: +64 3 962-0382 > Fax: +64 3 962-0388 > >
Re: Paged search results
I guess my confusion comes into a lack of terminology and understanding of how to approach this problem. What we would like to do is be able to perform a search on the DB, but only show the user 10 of the results at a time. Initially we have thought that sessions might be the key to this, but then wondered what would happen if the user had more than one browser window open, clearly they would be clobbering each others cached search results, no? So we have also thought about perhaps using another table to store the results from each search performed associated with each browser window through attempting to add a unique value to a query string which will also be the PK in the table of search results. This way we can move the current record pointer forward and backwards at will and allow for people having more than one browser window open while doing searches. Do these concerns/strategies sound sane? If not, maybe it is a reflection of my own state of mind (i.e. insane :) Many thanks to those that have currently contributed to this discussion. -- Holden Glova, [EMAIL PROTECTED] Software Engineer Alchemy Group Limited Level 6 Royal Sun Alliance Bldg PO Box 2386 Christchurch New Zealand Phone: +64 3 962-0382 Fax: +64 3 962-0388
Re: Paged search results
Hmm..just want to clarify I understand exactly what you are saying here. If I have 2 or more browser windows open then each will be associated with a separate session? Perhaps I worded it wrong previously. Johan Fredriksson wrote: > For multibrowser usage, there will be separate sessions for those. There is > probably a way to get them to use the same session, but I haven't tried > this. In this case I suggest a hashtable in the application object and an id > string ( key in hashtable ) in the session. > > Hope this at least gives you a couple of ideas on how to get started. > > regards > > Johan > - Original Message - > From: "Holden Glova" <[EMAIL PROTECTED]> > To: "Orion-Interest" <[EMAIL PROTECTED]> > Sent: Wednesday, March 28, 2001 6:19 AM > Subject: Paged search results > > > Hi all, > > > > Perhaps this is slightly off topic and > > if so, I apologize and feel free to > > ignore this. My knowledge of j2ee is not > > high but I would like to know the best > > way to handle this with of course, > > minimal complexity. I am not sure where > > else I can find information on this > > subject from knowledgeable people > > though, so here goes. > > > > We are wondering what the best approach > > would be move through a collection of > > page results that come back from a > > search. We have thought about using > > sessions to cache the results and help > > keep track of what the current result > > view consists of, but we are not sure if > > this is the best way to handle something > > like this. Some things that come to mind > > are what would happen if we have > > multiple browsers open trying to perform > > different searches at the same time, > > would we need a separate SessionBean to > > cache these results in? > > > > What could be some of the advantages and > > disadvantages of using sessions for this > > problem? Can anyone point me to some > > other ways of approaching this problem > > aside from using sessions? > > > > Thanks in advance for any help and > > pointers that are given. > > > > Regards, > > > > -- > > Holden Glova, [EMAIL PROTECTED] > > Software Engineer > > Alchemy Group Limited > > Level 6 Royal Sun Alliance Bldg > > PO Box 2386 > > Christchurch > > New Zealand > > Phone: +64 3 962-0382 > > Fax: +64 3 962-0388 -- Holden Glova, [EMAIL PROTECTED] Software Engineer Alchemy Group Limited Level 6 Royal Sun Alliance Bldg PO Box 2386 Christchurch New Zealand Phone: +64 3 962-0382 Fax: +64 3 962-0388
RE: Paged search results
What a totally cool idea. We have this problem with persistance of xml objects which are the same for the whole application. We did not want to parse the darn xml doc every time we opened our servlet or init'ed the session bean, and an entity bean was way to heavy for our need. Thanks for helping us seriously increasing the speed of our app. Regards, elephantwalker -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of cybermaster Sent: Wednesday, March 28, 2001 8:47 AM To: Orion-Interest Subject: RE: Paged search results "application" is an instance of javax.servlet.ServletContext which is available in JSPs; this object has application scope and therefore is a good place to store objects [with: application.setAttribute(name, object) ] which you want to make available to servlets/JSPs throughout an application. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Andy Chapman Sent: Wednesday, March 28, 2001 2:39 AM To: Orion-Interest Subject: Re: Paged search results Johan, Please enlighten me - what is the application object that you refer to? Is it just a single entity EJB that maintains common state - ie caches, application settings etc? Is there some discussion of it anywhere as an element of J2EE application design? Thanks, Andy - Original Message - From: "Johan Fredriksson" <[EMAIL PROTECTED]> To: "Orion-Interest" <[EMAIL PROTECTED]> Sent: Wednesday, March 28, 2001 8:17 AM Subject: Re: Paged search results > My first thought is that a cache should not be stored in a session, since > that would only be available in that session and "cannot" be shared... > Better to store a searchresult in the application object ( if the result is > static and is the same for all users). If the searchresult is specific to a > certain user, then you could store it in a session. > > For multibrowser usage, there will be separate sessions for those. There is > probably a way to get them to use the same session, but I haven't tried > this. In this case I suggest a hashtable in the application object and an id > string ( key in hashtable ) in the session. > > Hope this at least gives you a couple of ideas on how to get started. > > regards > > > > Johan
RE: Paged search results
"application" is an instance of javax.servlet.ServletContext which is available in JSPs; this object has application scope and therefore is a good place to store objects [with: application.setAttribute(name, object) ] which you want to make available to servlets/JSPs throughout an application. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Andy Chapman Sent: Wednesday, March 28, 2001 2:39 AM To: Orion-Interest Subject: Re: Paged search results Johan, Please enlighten me - what is the application object that you refer to? Is it just a single entity EJB that maintains common state - ie caches, application settings etc? Is there some discussion of it anywhere as an element of J2EE application design? Thanks, Andy - Original Message - From: "Johan Fredriksson" <[EMAIL PROTECTED]> To: "Orion-Interest" <[EMAIL PROTECTED]> Sent: Wednesday, March 28, 2001 8:17 AM Subject: Re: Paged search results > My first thought is that a cache should not be stored in a session, since > that would only be available in that session and "cannot" be shared... > Better to store a searchresult in the application object ( if the result is > static and is the same for all users). If the searchresult is specific to a > certain user, then you could store it in a session. > > For multibrowser usage, there will be separate sessions for those. There is > probably a way to get them to use the same session, but I haven't tried > this. In this case I suggest a hashtable in the application object and an id > string ( key in hashtable ) in the session. > > Hope this at least gives you a couple of ideas on how to get started. > > regards > > > > Johan
Re: Re: Paged search results
check out this link for application wide sharing. http://java.sun.com/docs/books/tutorial/servlets/communication/attribu tes.html _ Get your free E-mail at http://www.ireland.com
Re: Paged search results
Johan, Please enlighten me - what is the application object that you refer to? Is it just a single entity EJB that maintains common state - ie caches, application settings etc? Is there some discussion of it anywhere as an element of J2EE application design? Thanks, Andy - Original Message - From: "Johan Fredriksson" <[EMAIL PROTECTED]> To: "Orion-Interest" <[EMAIL PROTECTED]> Sent: Wednesday, March 28, 2001 8:17 AM Subject: Re: Paged search results > My first thought is that a cache should not be stored in a session, since > that would only be available in that session and "cannot" be shared... > Better to store a searchresult in the application object ( if the result is > static and is the same for all users). If the searchresult is specific to a > certain user, then you could store it in a session. > > For multibrowser usage, there will be separate sessions for those. There is > probably a way to get them to use the same session, but I haven't tried > this. In this case I suggest a hashtable in the application object and an id > string ( key in hashtable ) in the session. > > Hope this at least gives you a couple of ideas on how to get started. > > regards > > > > Johan > - Original Message - > From: "Holden Glova" <[EMAIL PROTECTED]> > To: "Orion-Interest" <[EMAIL PROTECTED]> > Sent: Wednesday, March 28, 2001 6:19 AM > Subject: Paged search results > > > > Hi all, > > > > Perhaps this is slightly off topic and > > if so, I apologize and feel free to > > ignore this. My knowledge of j2ee is not > > high but I would like to know the best > > way to handle this with of course, > > minimal complexity. I am not sure where > > else I can find information on this > > subject from knowledgeable people > > though, so here goes. > > > > We are wondering what the best approach > > would be move through a collection of > > page results that come back from a > > search. We have thought about using > > sessions to cache the results and help > > keep track of what the current result > > view consists of, but we are not sure if > > this is the best way to handle something > > like this. Some things that come to mind > > are what would happen if we have > > multiple browsers open trying to perform > > different searches at the same time, > > would we need a separate SessionBean to > > cache these results in? > > > > What could be some of the advantages and > > disadvantages of using sessions for this > > problem? Can anyone point me to some > > other ways of approaching this problem > > aside from using sessions? > > > > Thanks in advance for any help and > > pointers that are given. > > > > Regards, > > > > -- > > Holden Glova, [EMAIL PROTECTED] > > Software Engineer > > Alchemy Group Limited > > Level 6 Royal Sun Alliance Bldg > > PO Box 2386 > > Christchurch > > New Zealand > > Phone: +64 3 962-0382 > > Fax: +64 3 962-0388 > >
Re: Paged search results
My first thought is that a cache should not be stored in a session, since that would only be available in that session and "cannot" be shared... Better to store a searchresult in the application object ( if the result is static and is the same for all users). If the searchresult is specific to a certain user, then you could store it in a session. For multibrowser usage, there will be separate sessions for those. There is probably a way to get them to use the same session, but I haven't tried this. In this case I suggest a hashtable in the application object and an id string ( key in hashtable ) in the session. Hope this at least gives you a couple of ideas on how to get started. regards Johan - Original Message - From: "Holden Glova" <[EMAIL PROTECTED]> To: "Orion-Interest" <[EMAIL PROTECTED]> Sent: Wednesday, March 28, 2001 6:19 AM Subject: Paged search results > Hi all, > > Perhaps this is slightly off topic and > if so, I apologize and feel free to > ignore this. My knowledge of j2ee is not > high but I would like to know the best > way to handle this with of course, > minimal complexity. I am not sure where > else I can find information on this > subject from knowledgeable people > though, so here goes. > > We are wondering what the best approach > would be move through a collection of > page results that come back from a > search. We have thought about using > sessions to cache the results and help > keep track of what the current result > view consists of, but we are not sure if > this is the best way to handle something > like this. Some things that come to mind > are what would happen if we have > multiple browsers open trying to perform > different searches at the same time, > would we need a separate SessionBean to > cache these results in? > > What could be some of the advantages and > disadvantages of using sessions for this > problem? Can anyone point me to some > other ways of approaching this problem > aside from using sessions? > > Thanks in advance for any help and > pointers that are given. > > Regards, > > -- > Holden Glova, [EMAIL PROTECTED] > Software Engineer > Alchemy Group Limited > Level 6 Royal Sun Alliance Bldg > PO Box 2386 > Christchurch > New Zealand > Phone: +64 3 962-0382 > Fax: +64 3 962-0388