Anybody explain me about how to sahre the session data between two war. Also how to call the jasp in one war from other.
Thanks & Regards, Sitaraman
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13433
posted
0
A war file is just a packaged web app.
The servlet spec doesn't go into a lot of detail on the subject of cross context communication so you can expect inconsistent behavior across containers at best. For this reason, you will need to consult the documentation for the container you're using.
I don't understand this next question.
Also how to call the jasp in one war from other.
Maybe you can re-phrase it or go into a little more detail?
There isn't such thing as "calling" a JSP. You'll need to be more explicitly regarding what you want to do. Are you just trying to create a link to the foreign JSP?
ie how to rediredt from the jsp in one war to jsp in other war.But i got it now.I think we can go for sendredirect.
But please advice whetehr their is any way to share th data between the war files.
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13433
posted
0
Again, the war file isn't the application. It's the packaging. The term you're looking for is 'context' which is synonymous with 'application' or 'web application'; often just called 'webapp' or 'app' for short.
Yes, you can use sendRedirect to redirect to a JSP in another context. Because sendRedirect uses the browser to generate a new request, you can use it to redirect to any page, even pages outside your context, server, or domain.
The spec also makes it possible to forward to a resource in another context but security conscious containers don't allow this by default.
sita raman subra
Ranch Hand
Joined: Apr 09, 2007
Posts: 47
posted
0
But in my project A suppose to pass data from my application to other running in the same server
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 32421
posted
0
You'll need to be more specific about what "pass data from my application to other" means - From java class to Java class? Through parameters in a link? An HTML form?
In general, there are any number of ways for two web apps to exchange data: through files, database, email, messaging, web service, RMI, HTTP, sockets, ... What's appropriate really depends on the circumstances, about which you haven't said anything.