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.

Similar Messages

  • 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.

  • 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 can I interact between two different frames in the same indesign template as well as from one template to another.

    I am looking for the best way (or any way) to interact between two different frames in the same indesign template as well as from one template to another. It's for a DPS app which needs to carry some button initiated data from one page to another and then present it in a table.

    There is no simple way to do it, as itunes wont let you use it on another computer without wiping the contents first.
    However if you really want to transfer songs to another computer then you could try this;
    * make sure that your ipod is accessible as a disk drive (ipod options)
    * when you plug your ipod into the computer you want to transfer to make sure you select "no" or "cancel" when it asks to wipe the contents. Leave the ipod connected and quit from itunes.
    * go to "my computer" and access the ipod directly. You probably have to select "view hidden files" from windows. You will see a lot of folders with odd names like ZX838aff with similar named files inside.
    * copy these files to a folder on your computers hardrive. Now remove the ipod and start itunes.
    * import the files from the folder you made in the last step.
    * Now your music is on itunes, but with unrecogisable names.
    This is the only way I have found to do it, but there may be another way, say with an application to do the hard work for you.
    Generic homebuild PC Windows XP
    Generic homebuild PC   Windows XP  

  • 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

  • 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.

  • 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 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

  • 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.

  • 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.

  • 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.

  • Drag between two flex applications?

    Hi,
    In the project I'm working on I display tree which the user can manipulate by dragging and dropping. So far I have a tree in a flex application, and I've implemented dragging and dropping. I'd like the user to be able to drag from one tree to another, but as my flex application will interact with my HTML pages, I don't want to waste space by having room for the second tree all the time.
    The flex application is embedded on a HTML page, and I'd like to be able to have two instances of my flex application and have the user able to drag between them. Is this possible? I did wonder if it would be possible to implement something like this using a javascript callback, but is there a standard way of doing this?
    Thanks,
    Jonny

    Hi Jonny,
    I've also faced with problem of draging between two applications.
    It's possible to transmit data between these applications, but it's only a half of the task.
    The main problem it to handle mouse release error on second application.
    There is no problem to handle that user drag object and move it out of the component - it's ok.
    After that we should handle the position of droping this object.
    Also it's no problem to handle that mouse is on over component and left button is pushed (at this handle create imitation of starting draging). But it's impossible to handle first mouseUp event. This event don't visible in html (object don't rise mouseUp event) and don't handle in flex. I'm still try to understand the way to get round.
    The only way I've founded is to hide flash object on mouseOver event and show an image instead of it until mouseUp event raised. After that show flash and calculate the position of draging. But's if you use tree it's not a good way.

  • Failed to retrieve data from the database/invalid argument provided when employing link between two web services datasources

    Post Author: vpost
    CA Forum: Data Connectivity and SQL
    I am trying to join information from two related web services within CR XI. I have successfully set up the web services as data sources have been able to get to the point where I get good data back. However, when I try to pull in certain fields, I get an error that says "Failed to retrieve data from the database/invalid argument provided". Here's the scenario:
    The web services are structured as follows:Web Service 1 (Artist) has attributes of Artist Name and Date of Birth.Web Service 2 (CD) has attributes of CD Title and Release Date. Underneath each CD are songs, each of which have a Song Title and Artist Name.
    I have defined both web services and defined a link between Artist.Artist Name and CD/Song.Artist Name. I am able to run a report with Song Title and Date of Birth that crosses web services. I am able to run another report with Song Title and CD Title that crosses the different levels in the second web service. However, if I add CD Title to the first report or Date of Birth to the second (both of which effectively force CR to employ the link between the two web services AND the CD/Song hierarchical structure in the second web service, I get the aforementioned error.
    Any assistance understanding how multiple web services can be linked in this manner would be greatly appreciated.
    Thanks in advance.

    Post Author: Mike Wright
    CA Forum: Data Connectivity and SQL
    Not sure about your exact situation, but having similar problem with another application and have tracked down to security. Added user to group Domain Admin and it works fine. It appears to be accessing a subdirectory which it does not have permission to use and then times out and returns the "invalid....". Seems that once the query just over a certain size (and I'm not sure what triggers this) it needs to make use of temparory file disk, intead of ram.
    I'm still trying to track down which temporary it's trying to uses - so if you have any ques.
    cheers

  • Interaction between Actionscript 2 application and Actionscript 3 application

    Hi,
                  I got a project to refectoring. Its coded in as2. As One application (TabManager) has 5-6 tabs, and loading different swfs (coded in as2) at click on different tabs. Then according to user interactions, the loaded swfs are interacting with tabmanager (main swf) file like calling functions and sending objects and tabManager swf is also interacting with its loaded swfs. In short, All swfs are interacting each other.
    Now, I have to develop two application, one is the main application "TabManager" and other one is 3rd (one application out of 5-6 applications, whose are loading in tabmanager) loaded application in tabManager.
    To make the long story short, I need to load action script 2 coded applications under a action script 3 application and need to call each other function and send object type data.
    So, please suggest the best options, One I know is LocalConnection class.
    Is there any other better way to interact between as2 and as3.

    there is no other way to communicate between as3/as2 swfs in real time.

Maybe you are looking for

  • Create password access to a site in Dreamweaver CC

    Trying to create a password protected site. I have an intro page and want to have a password required to access the main site. I am using hostgator and from what I can see, they only have a username password access. I need just the password access fo

  • How can i create a Step in OBBH

    Hi. I want to use a exit with " exits-param = C_EXIT_PARAM_CLASS." in T-code "OBBH' to change the test of doc item. I create the form and append this form into exits. But now I find  i can't create a step in "complete document". Message: You may not

  • Looking for a specific font..Help!

    Does anybody know what font this is? Desperately trying to find it.. I've looked through dafont.com, fonts.com and 1001fonts.com but nothing matches. Thanks for your help!

  • Safary crashing!

    hi everybody i just updated my osX to yosemite in  2 weeks now today i just install an application (android emulator) , when it was downloading safari started to crashing and not opened yet the error : Process:           Safari [970] Path:           

  • Cannot find some fields from SAP interface (employee master data screen)

    Dear All, We are using SAP881 US localization. When I open OHEM table or form settings of list of employees, I can see some additional fields. E.g. Health insurance code Vacation: Current year Those fields I cannot see it from the interface. Can anyb