• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Looking in the Crystal Ball

 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there anything in that there com.javaranch.common thingie that enables/simplifies the use of a ServletContext?
-Barry
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are things to use instead of ServletContext. Depends on what you're looking for.
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sharing stuff between servlets?
-Barry
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In what way does the use of a ServletContext seem too complex for your needs?
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Absolutely no way. A ServletContext is what I want to use. But for an assignment I am required to use classes in the com.javaranch.common package if they perform a function I need. I have not yet seen anything that can help. I just wanted confirmation that I am correct. I also do not want to *give the game away* as they say.
Also there are some undocumented classes in the API, for example DataPool. Are they only for package internal use or what?
-Barry
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Suppose you write an application (not a servlet) and you have two classes that need to share some common data. How do you do it?
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Barry Gaunt:
Also there are some undocumented classes in the API, for example DataPool. Are they only for package internal use or what?



DataPool You can also look at the source code.
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Marilyn, but I looked at this page and there is no description. At the mo' I'm just surveying the lie of the land in advance, so browsing the source ain't mything Duke, not right now that is

Ah Ha, I see that DataPool pops up in the second part! But why on earth is it a Thread? Is it OK to fire of threads within servlets? Gotta research this...
[ January 19, 2003: Message edited by: Barry Gaunt ]
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Marilyn de Queiroz:
Suppose you write an application (not a servlet) and you have two classes that need to share some common data. How do you do it?


I can think of a few ways to do it including sockets, pipes, files, IBM message queues, RMI, databases, writing and reading papertape or punched-cards, and one other simpler way that would definitely need one of them there Magical Mystery Classes or whatever.
PS I forgot, JMS would also be a possibility.
Using the ServletContext would expose the data outside the two servlets required by the transaction. So maybe I should not wander off in that direction.
One more leetle question: For OOP-4a, do I need to persist the the Video Library data between restarts of the server?
[ January 19, 2003: Message edited by: Barry Gaunt ]
 
whippersnapper
Posts: 1843
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Barry Gaunt:
I can think of a few ways to do it including sockets, pipes, files, IBM message queues, RMI, databases, writing and reading papertape or punched-cards,
Ugh! You're killing me, man.
and one other simpler way that would definitely need one of them there Magical Mystery Classes or whatever.
Smart money's going on some simpler way (of which there are several).
[ January 19, 2003: Message edited by: Michael Matola ]

 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One more leetle question: For OOP-4a, do I need to persist the the Video Library data between restarts of the server?

Not until you get to the JDBC stuff.
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have got a little "proof of concept" working so Mad Scientist can realise his 4a now. Thanks for the tips/jogs/kicks.
 
Won't you be my neighbor? - Fred Rogers. tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic