• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

.war to .war communication

 
sita raman subra
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ben Souther:
..

I don't understand this next question.

Maybe you can re-phrase it or go into a little more detail?


I guess he was intended to ask 'how to call a jsp in one war file from another'! Is it not?
 
sita raman subra
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes its JSP not JASP.sorry.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
sita raman subra
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But in my project A suppose to pass data from my application to other running in the same server
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic