Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Servlet 4a question

 
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May I adjust Videos.java to 'implements Serializable'?
To save data over time, different sessions, I only can think of the database (see JDBC assignments) or using serialization.
If there are more possibilities I need a hint. :confused
 
Sheriff
Posts: 9099
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need to save data over time for Servlets-4a assignment. We will be saving it in a database in the JDBC assignments. You shouldn't need Serializable. Assume multiple users will be accessing the data on-line in different sessions at the same time. The data will be in the server's memory.
[This message has been edited by Marilyn deQueiroz (edited October 31, 2001).]
 
Peter Gragert
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Marilyn,
I do not understand your nitpicking remark anymore.


This is the wrong approach because the video list is now available only to one session.
I want the same list available to all sessions. This is the cornerstone of the lesson.


Why: if I open different browsers and logon to
localhost/videos.html
All can see and add to the videolist. If I close all browsers
and login again the videolist is still available.
Therefore what is wrong to my approach?
Only if I stop orion, all info has gone.
:confused
It seams to me, that I do not understand what you mean with 'session'???

 
Marilyn de Queiroz
Sheriff
Posts: 9099
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If one browser adds to the video list, can you see the changed videolist in the other browser?
 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Marilyn deQueiroz:
If one browser adds to the video list, can you see the changed videolist in the other browser?


I think I used the same approach as Peter for my first try, and yes, it worked between browsers.
 
Peter Gragert
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it does!
 
Trailboss
Posts: 23209
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The solution we are looking for must have the same data available to all users. No database stuff should be involved at this point.
 
Marilyn de Queiroz
Sheriff
Posts: 9099
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the assignment is the following text: "The big challenge in this assignment is to get the two servlets to share data. Remember, a Servlet is just a class and these two classes will be working within the same VM."

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?

[This message has been edited by Marilyn deQueiroz (edited November 04, 2001).]
 
Peter Gragert
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Marilyn,
I suppose you have my code. Let it run. I really do not understand all the comments in this thread.
The servelets communicate very well, other clients see and can adjust the 'video-list' (no database idea used yet). As long as 'orion' does not stop the list can grow.
If not here, then please send a mail to me.
 
Chicken Farmer ()
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know! I know!
*waves his hands frantically in the air*
 
Peter Gragert
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jason,
Give a hint of an idea. Pls.
 
Marilyn de Queiroz
Sheriff
Posts: 9099
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I emailed Peter. I don't think I could give any other hint here without giving too much away.

[This message has been edited by Marilyn deQueiroz (edited November 05, 2001).]
 
Peter Gragert
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I will try !
 
jason adam
Chicken Farmer ()
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, the one Marilyn gave earlier is pretty much spelling it out. Think basic concepts here.
 
    Bookmark Topic Watch Topic
  • New Topic