Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #28519

Re: share data between two tomcat contexts?

Date 2014-05-17 13:04 +0100
From lipska the kat <lipskathekat@example.com>
Organization Trollbusters 3
Newsgroups comp.lang.java.programmer
Subject Re: share data between two tomcat contexts?
References <ll675j$4rn$1@news.m-online.net> <MZqdnW2ubo69nurOnZ2dnUVZ8rSdnZ2d@giganews.com> <ll7gok$ghl$1@news.m-online.net>
Message-ID <AuKdnR-qGvLVzerOnZ2dnUVZ8lWdnZ2d@bt.com> (permalink)

Show all headers | View raw


On 17/05/14 12:22, Laura Schmidt wrote:
> On 05/17/2014 08:35 AM, Leif Roar Moldskred wrote:
>> Laura Schmidt <ls@mailinator.com> wrote:
>>> Hi,
>>>
>>> I want to share some data between two tomcat applications running on the
>>> same server.
>>>
>>
>> Are there performance demands that prevents you from having one
>> application just make HTTP requests to the other and ask for the data
>> when it needs it?
>
> Well, the first application is an existing legacy application where
> users can login.
>
> When logged in, they are informed about a relaunch of the application
> and they can follow a link to it.
>
> Within the new application I would like to know the identity of the user
> who is coming from the legacy application. This is why I would like to
> access the other one's sesson.

It *sounds* like you are talking about single sign on.
AFAIK you need access to ../conf/server.xml to implement this.

I use contexts to store data (mostly images) outside the scope of the 
current context. So in

/opt/apache-tomcat-7.0.42/conf/Catalina/localhost

I have two xml files

images.xml and sitemap.xml

here's the xml for sitemap

<Context path="/sitemap" docBase="/var/sitemap" crossContext="true"/>

now, I can generate a new sitemap, store it somewhere where it won't be 
deleted when I redeploy the webapp and access it like

http://www.mydomain.com/sitemap/mysitemap.xml

I'm not sure you can access a session in one web app from another web 
app anyway, even if you do have access to it's context.

You might do better asking on the tomcat users mailing list

http://tomcat.apache.org/lists.html#tomcat-users

rgds



-- 
Lipska the Kat©: Troll hunter, sandbox destroyer,
treacherous feline and farscape dreamer of Aeryn Sun
GNU/Linux user #560883 - http://www.linuxcounter.net

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

share data between two tomcat contexts? Laura Schmidt <ls@mailinator.com> - 2014-05-17 01:32 +0200
  Re: share data between two tomcat contexts? markspace <markspace@nospam.nospam> - 2014-05-16 16:41 -0700
    Re: share data between two tomcat contexts? Laura Schmidt <ls@mailinator.com> - 2014-05-17 02:19 +0200
      Re: share data between two tomcat contexts? markspace <markspace@nospam.nospam> - 2014-05-16 17:40 -0700
        Re: share data between two tomcat contexts? Laura Schmidt <ls@mailinator.com> - 2014-05-17 08:16 +0200
      Re: share data between two tomcat contexts? Josip Almasi <joe@vrspace.org> - 2014-05-17 09:29 +0200
  Re: share data between two tomcat contexts? Arne Vajhøj <arne@vajhoej.dk> - 2014-05-16 19:45 -0400
    Re: share data between two tomcat contexts? Robert Klemme <shortcutter@googlemail.com> - 2014-05-17 12:46 +0200
  Re: share data between two tomcat contexts? leif.roar@invalid.com (Leif Roar Moldskred) - 2014-05-17 01:35 -0500
    Re: share data between two tomcat contexts? Laura Schmidt <ls@mailinator.com> - 2014-05-17 13:22 +0200
      Re: share data between two tomcat contexts? lipska the kat <lipskathekat@example.com> - 2014-05-17 13:04 +0100
      Re: share data between two tomcat contexts? leif.roar@invalid.com (Leif Roar Moldskred) - 2014-05-17 08:25 -0500
      Re: share data between two tomcat contexts? "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2014-05-17 17:21 +0100
      Re: share data between two tomcat contexts? Robert Klemme <shortcutter@googlemail.com> - 2014-05-18 10:12 +0200
      Re: share data between two tomcat contexts? lipska the kat <lipskathekat@example.com> - 2014-05-18 11:13 +0100
      Re: share data between two tomcat contexts? Brixomatic <brixomatic@yahoo.com> - 2014-05-22 18:58 +0200
  Re: share data between two tomcat contexts? "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2014-05-17 11:11 +0100

csiph-web