Victor
Victor

Reputation: 8490

Tomcat: How to share data between two applications?

Is there any way to share data between to JSP applications using Tomcat 5.5?

The applications are running in the same server.

The shared data should not persist in the system for many time and cannot be stored in cookies because it's bigger than 4Kb.

Thanks! :)

Upvotes: 3

Views: 3397

Answers (2)

BalusC
BalusC

Reputation: 1109532

Just put the data in a file on the disk file system or a database server which both have access to.


Update: as per the update and the comments, the functional requirement seems to boil down to let the webapps on the same server share the same HttpSession (including all of its attributes). In that case, you need to set the emptySessionPath attribute of the <Connector> element in Tomcat's /conf/server.xml to true.

<Connector emptySessionPath="true">

Upvotes: 1

Jonathan Holloway
Jonathan Holloway

Reputation: 63734

You could look at the crossContext attribute to allow you to share data via the context object. Previous Stackoverflow here:

What does the crossContext attribute do in Tomcat? Does it enable session sharing?

Upvotes: 1

Related Questions