[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Win a copy of Flex 4 in Action this week in the Flex forum!
Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » Servlets
 
RSS feed
 
New topic
Author

.war to .war communication

sita raman subra
Ranch Hand

Joined: Apr 09, 2007
Messages: 47

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

Joined: Dec 11, 2004
Messages: 13045

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?

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Messages: 3028

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?

Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials]
sita raman subra
Ranch Hand

Joined: Apr 09, 2007
Messages: 47

Yes its JSP not JASP.sorry.
Bear Bibeault
Author and opinionated walrus
Sheriff

Joined: Jan 10, 2002
Messages: 36508

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?

[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
sita raman subra
Ranch Hand

Joined: Apr 09, 2007
Messages: 47

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
Messages: 13045

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.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples
sita raman subra
Ranch Hand

Joined: Apr 09, 2007
Messages: 47

But in my project A suppose to pass data from my application to other running in the same server
Ulf Dittmer
Sheriff

Joined: Mar 22, 2005
Messages: 26745

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.

Java web chartsImageJ PluginsSpecification URLsJava FAQs
 
jQuery in Action
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » Servlets
 
RSS feed
 
New topic
hibernate profiler