This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sharing of session objects across two web applications running on same server instance

 
sandeep Kumar
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a requirement as below:

There are two web applications running on the same server instance. If there is a requirement as I have to use data in session object of webApp1 in webApp2.

Can you please suggest me the best way to implement it?

Thanks in Advance.

Cheers,
Sandeep.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about using a database?
 
sandeep Kumar
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul Sturrock,

First of all thanks for your reply.

Due to some client specific constraints, I cannot use the Database. Keeping apart form Database and RMI, Can you please suggest me the other way.

What if I serialize the object into a flat file and then FTP that file? I think this would again be some performance hit.
Is there any way we can send the data in request to another application?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you abandon the use of the session (no bad thing, by the way) and redesign your applicaitons to send state with the request that would work. Otherwise you will need some common persistence mechanism to share the data in. FTP doesn't sound the like the right mechanism, things will always be out of date. If you can't use RMI either this is harder to do - I was going to suggest a distributed cache, but distributed caches are RMI based.
 
Aniruddh Joshi
Ranch Hand
Posts: 275
Eclipse IDE jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
persist the session object ?
 
sandeep Kumar
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yep. I think sending through request would be right choice for my requirement.

Paul, Thanks for your reply.
Aniruddh: I dont want to persist the session object. Thank you for your suggestion.

Cheers,
Sandeep.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic