How change information between two Web Applications?

Hi,
Has anyone any code sample or article how to build
a "bridge" that would change data stored into session and servletcontext
between two separete web application in same servlet engine?
What I have understood is that they can not normally share same
session or servletcontext data...
Thanks,

Hmm...
Text in this Sun's tutorial says:
"This lesson, however, shows you what to do if your servlet requires a resource available from its own server"
The actual problem is following:
- In Web Application 1 servlets/jsps stores data into session object and servletcontext
- then user can request a page in Web Application 1 which should "activate/launch" Web Appilication 2 and
pass some session objects or objects stored into servletcontext from Web Application 1 to Web Application 2.
How to do this, it's the problem.

Similar Messages

  • Interaction between two web applications

    Hi All,
    I have an issue regarding 2 web projects.
    I have
    web application-----------related context path
    project1 ----------path1
    project2 ------------path2
    Scenario:
    Step1)
    I have logged in project1 with the foll url:
    http://localhost:8080/path1/index.jsp
    Step2);
    In index.jsp i have a button to navigate to
    http://localhost:8080/path2/page1.jsp
    Issue:
    Here is the issue.I have set one session attribute set in step1 and i need to acces it in step2.Im getting the attribute as null in step2.
    Can any one please let me know wht and where the issue is and the solution for it.
    Please help me out.
    Thanks in advance
    cheers,
    Shorath

    The fundamental problem is that web apps basically have no knowledge of each other. So if you're deploying to seperate WAR files, they're pretty much independent of each other and, specifically, can not share session data at all.
    If you want to share data between webapps, you need to use something outside the container (like a database), or you can play games with class loaders, and static class elements, making sure that your common classes are loaded outside of the webapps themselves.
    For example, in Tomcat, the shared and common directories hold classes that are loaded by the container directly and presented to your webapps.
    If you have a class with static members loaded from the common or shared directory, then both webapps will see the same instances of that class, and can share information that way. However, these classes will not be reloaded if you reload the webapps, only if you restart the container.
    The other problem, of course, is that these classes are agnostic of the session, so you'll need to implement your own session management if the data is unique to the users of your application. Kind of a catch-22.

  • Communication between two web applications deployed on same app server

    I need to update the war file of one application(say Application A) from another application(say application B). Actually application B is the admin application of application A.
    In order to achieve this, I need to get the ServletContext of A from B. How can I do that?
    P.S: Both the applications will be deployed on the same app server and they are app server independent.

    from the JavaDocs:
    http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletContext.html
    getContext
    public ServletContext getContext(java.lang.String uripath)
    Returns a ServletContext object that corresponds to a specified URL on the server.
    This method allows servlets to gain access to the context for various parts of the server, and as needed obtain RequestDispatcher objects from the context. The given path must be begin with "/", is interpreted relative to the server's document root and is matched against the context roots of other web applications hosted on this container.
    In a security conscious environment, the servlet container may return null for a given URL.
    Parameters:
    uripath - a String specifying the context path of another web application in the container.
    Returns:
    the ServletContext object that corresponds to the named URL, or null if either none exists or the container wishes to restrict this access.
    See Also:
    RequestDispatcher

  • How to exchange data between two web application (servlet)

    Hello, all,
    I have two servlets: SerlvetA and ServletB, they are deployed as web appA and appB in the same web container(tomcat)
    How ServletA exchange data with ServletB?
    I have tried follow methods:
    1) appA and appB could not share HttpSession, so I could not transfer data through session
    2) I write a new sigleton java class called AppBroker, servletA get AppBroker's instance, and set some data into the it. ServletB could not get the same instance of the AppBroker, because the appA and appB use different class loader.
    tell me how to?

    thanks reply, but
    1. static class can not solve the problem, it is same
    as my sigleton class method, as different web app use
    different class loaderhmm... at least in tomcat this seems not be true since i can use static classes in one webapp that are available in another web app on the same host/servlet runner.
    Maybe if you build your own classloader than the "scope" of the static class is limited to that classloader (for my understanding this shouldn't be the case since i think it depends on the instance of the jvm and not of the classloader..?!).
    2. rmi and object serialization are too expensive!
    I am working on how to use jndi to solve this problem.
    And I think this maybe a Sevlet specification's
    shortcoming: maybe a Local Method as EJB local
    interface need been introduced into servlet spec.
    could you suggestion other methods?none at the moment. i guess the basic methods are listed.
    Maybe there's just one left, a really ugly one. Depending on what kind of data and how often you have to exchange you could think of building a file-based queue, i.e. a dir where you drop files in an read out from the other web app (maybe based on a file/directory listener). But this would only be an appropriate way to go for kind of email and messaging systems i guess...

  • How to communicate between two servlet applications.

    I want to write a program that the system manager can see who is connecting the server.
    the system manager login the server via the browser with applet.
    the applet communicate with servlet .and the servlet work in the server get the customer message such as username ,Ip address etc from other servlet.
    how to realize it .?
    can you give some advice .
    I appreciate you .
    thank you

    Look at, http://forum.java.sun.com/thread.jsp?forum=54&thread=262144

  • How to share HttpSession between different web application ?

    I have two web application ( ie two different war files), I discovered that the jsp in the two war files are not able to share the HttpSession, may I know how to you share the HttpSession between two different web application ?

    From the api doc:
    "Session information is scoped only to the current web application (ServletContext), so information stored in one context will not be directly visible in another."
    You can not share a Session object between web apps. You can create your own sessions using a database, textfile or hashmap. Do a search on the O'Rielly web site for psuedo-sessions.

  • How to use two different ojdbc14.jar for two web application.

    Hi,
    I have two web application running in same tomcat, I need to use the two different ojdbc14.jar for two application, now both are taking the jars from tomcat common/lib directory, I tried copying the new ojdbc14.jar in web-inf/lib folder of one application, but it is not working.
    Could you please let me know whether this will take the jar from tomcat by befault or from web-inf, and a solution how to proceed with this.
    Thanks in advance.

    Yes, I tried removing the jars from common/lib, but as the connection string is mentioned inside the server.xml it is showing db connection error while trying to connect to the database

  • Integrating two web applications in JDev 9i

    Hi all,
    what is the best way to integrate two web applications developed independently, on JDeveloper 9.0.3.4?
    I tried with one project for each application but no success. I then tried as one project by tweaking another application that my application depends on. The other application handles user management, login etc. The problem is after logon I get the link to the services of my application, but the root context to which I am directed is not recognized because it is set as the root of that user management application. If I enter correct URL, then the session is not preserved and I am redirected to login page again, i.e. I cannot switch smoothly between application contexts and test how it works together.
    Many thanks,
    mile

    Hi Suman,
    For enabling SSO for web apps we need have 3 options in hand.
    Please check the below link for the three methods.
    http://help.sap.com/saphelp_nw04/helpdata/en/12/9f244183bb8639e10000000a1550b0/frameset.htm
    This also depends on the Portal version we are using, If the Portal is EP 6 APP integrator as you mentioned works but if its EP 7 pls use the below link for enabling SSO for web apps
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f05ae0f0-bf93-2b10-ed9e-a7320c012841
    Hope this helps solve your problems.
    Good Luck!
    Regards,
    Shaila
    Edited by: Shaila kasha on May 26, 2009 11:51 AM

  • Sharing data between two Web Apps

    Hi,
    I have got two web applications that share a MySQL database accessed by
    Kodo JDO. I have tremendous difficulty to share the state that one web
    application writes to the database with the second web application. The
    data seems to stay in the cache of the first app and I have not found a
    way to flush the data to the SQL database, so that the second can read it.
    I do a refresh on the relevant object within the second app. The problem
    seems to be flushing the cache of the first app.
    Best regards
    Wolfgang
    PS: To Solarmetric: Thanks for this wonderfull technology. I am building a
    complex database application, without having to learn SQL.

    Hi Greg,
    this:
    properties.setProperty("kodo.DataCache", "false");
    does not do the trick. There is no difference in behaviour. To use
    kodo.RemoteCommitProvider I would need the performance pack at 900 bucks a
    pop, which is not an option right now.
    Best regards
    Wolfgang
    Greg Campbell wrote:
    Hi Wolfgang,
    Are you using Kodo's Datastore cache in both web apps? I suspect that what
    is happening is that the data actually is being flushed to the database
    appropriately (assuming that you commit your transactions), but that your
    cache in your second app has stale data. Could you turn off the datastore
    cache in both apps just test that hypothesis?
    If your applications start to work as expected with the datacache off, then
    you should check out (assuming you're using Kodo v. 3.1.3)
    http://www.solarmetric.com/Software/Documentation/3.1.3/docs/ref_guide_event.html#ref_guide_event_conf
    That section of doc describes how to get the datastore caches in the two
    JVMs talking to each other.
    Thanks,
    Greg
    "Wolfgang Kundrus" <[email protected]> wrote in message
    news:ccli85$lae$[email protected]..
    Hi,
    I have got two web applications that share a MySQL database accessed by
    Kodo JDO. I have tremendous difficulty to share the state that one web
    application writes to the database with the second web application. The
    data seems to stay in the cache of the first app and I have not found a
    way to flush the data to the SQL database, so that the second can read it.
    I do a refresh on the relevant object within the second app. The problem
    seems to be flushing the cache of the first app.
    Best regards
    Wolfgang
    PS: To Solarmetric: Thanks for this wonderfull technology. I am building a
    complex database application, without having to learn SQL.

  • Connecting more than two web application

    I have 2 struts web application projects both are using different databases.
    how can i connect both web application in single web application.

    ravi.choudhary wrote:
    I have 2 struts web application projects both are using different databases.OK.
    how can i connect both web application in single web application.This question is too general and not technical. The statement "connect two applications in single application" makes also completely no sense. Please elaborate at a more technical level.

  • Need common page for two Web applications

    Hi,
    I got two web applications. I need to have a common point/ page to get access to them. I need to have a jsp or html page with two respective links. Providing this is fine but I need help as to how do handle switching the contexts.
    Any alternative solution is also welcome.
    Thx.

    Does it have to be an Itinerary?  This is fairly simple with just an Orchestration.

  • Two web Applications targeting one model project, missunderstand

    Hi sirs;
    Does two web application can use the same applicationModule Pooll Instance ? like the cenário below;
    Or
    Each web application must have it's own model Project ?
    JDev 11g, WebLogic Server Version: 10.3.1.0
    The simpliest way to explain my doubt;
    1. Lets create one Fusion ADF Application;
    1.1 ViewProject_One
    1.2 ViewProject_Two
    1.3 Model_Shared
    One index.jspx in each viewProject and one adfTable targeting the same AppModule ( here I tried also to create a second appModule extending the original )
    When we run ViewProject_One it works ok;
    When we Run ViewProject_Two it worsk ok;
    Whe we Runnig viewProject_two tried to browse ViewProject_One index.jspx whe crash into
    29/09/2009 09:52:52 UNEXPECTED_CLIENT_OBJECT_TYPE oracle.adf.controller.internal.metadata.xml.MetadataResourceXmlImpl
    SEVERE: oracle.adf.controller.internal.metadata.xml.MetadataResourceXmlImpl
    29/09/2009 09:52:52 org.apache.myfaces.trinidadinternal.agent.AgentFactoryImpl _populateUnknownAgentImpl
    WARNING: O User-Agent "mAgent" é desconhecido, criar um agente com atributos de agente "desconhecido".
    This post is an try-and-error of this original post Deploy Enterprise application with 2 modules ( web applications )
    Thank's for any help
    Thanks
    Edited by: Marcos Ortega on Sep 29, 2009 6:07 PM
    Edited by: Marcos Ortega on Oct 1, 2009 5:00 PM

    My question actually was not about compile time dependencies, but about run-time dependencies between two projects app1.jpr and app2.jpr.
    First project has J2EE context root /app1 and the second one has context root /app2.
    First project runs as http://localhost:8887/app1/login.jsp where user can login. After successful login it renders page with link to the page in the second project, e.g. http://localhost:8887/app2/welcome.jsp
    When user clicks on this link it is supposed to transfer control to the second web application app2.
    The problem is the first root context does not recognize the /app2 context. Only if you execute second project first it will start in its own root context which is /app2, but then it is not possible to use application app1, which must be executed first!?
    I guess application.xml, orion.xml, web.xml etc. must be configured but don't know how

  • How to redeploy Calculation Manager Web Application Server

    Hi All,
    I am installing a patch(13925741) for Calculation Manager, i stuck at the following point:
    6. Perform the standard Calculation Manager Web application server deployment task using Hyperion Enterprise Performance Management System Configurator (EPM System Configurator). See the Oracle Hyperion Enterprise Performance Management System Installation and Configuration Guide for instructions.
    I don't know how to redeploy Calculation Manager Web Application Server, plz help me in deploying this.
    The readme for the patch can be found at:
    https://updates.oracle.com/Orion/Services/download?type=readme&aru=15356919#_Toc330987031

    909062 wrote:
    Hi All,
    I am installing a patch(13925741) for Calculation Manager, i stuck at the following point:
    6. Perform the standard Calculation Manager Web application server deployment task using Hyperion Enterprise Performance Management System Configurator (EPM System Configurator). See the Oracle Hyperion Enterprise Performance Management System Installation and Configuration Guide for instructions.
    I don't know how to redeploy Calculation Manager Web Application Server, plz help me in deploying this.
    The readme for the patch can be found at:
    https://updates.oracle.com/Orion/Services/download?type=readme&aru=15356919#_Toc330987031
    Hi,
    Did you actually try to look at the Oracle Hyperion Enterprise Performance Management System Installation and Configuration Guide for instructions as suggested ?
    To redeploy a component, run the configurator that can be found in the start menu under Foundation Services. Then select "modify an existing instance". Then for Calculation manager, check the box "Deploy to application server".
    Thanks,
    JM

  • Can any one tell me how to talk between two controller.....

    Hi,
    Can any one tell me how to talk between two controller.....
    Help will be awarded.
    Regards,
    Gurprit Bhatia

    Hi Gurpit,
    If you want to share data between 2 controllers then you can simply do that by providing a data link between the controllers in your data modeler.
    If you want to use some methods of one controller in another then you can do it using
    wdThis.wdget<controller name>().<method name>();
    If your question is something different than this then please elaborate your requirement.
    Regards,
    Murtuza

  • Switching between 2 Web applications.

    Hello,
    I've two Web applications, A and B. A contains an HTML button to switch to B and vice-versa.
    At first I log in A. I work in A. Then I press the A->B button. I work in B. Then I press B->A button. I'm go back to A.
    I would like:
    - to keep the state of A and B: e.g. keeping the data already entered in HTML forms, A and B HTTP session;
    - but without setting session timeouts too long;
    - and without authenticating once again in A or B.
    What is the best way of achieving this? Any existing code?
    Thank you in advance for your collaboration.
    Greetings.
    Philippe Waltregny-Dengis

    Use persistent sessions.

Maybe you are looking for