Need a way to pass object to another application

Hello Everyone,
I need to pass an object from one application to another. I wanted to do that using request.setAttribute(Object) but this works only on RequestDispatcher.forward(URL) method and can be used only within the application you are currently in. It does not work for absolute URLs therefore I cannot go to another application. I also tried response.sendRedirect(URL) but then request object is lost when redirected to another application.
Any help will be greatly appreciated,
Thanks in advance,
Y.M.

if your two application servers are on the same box,
then you can get the RequestDispatcher object from
another ServletContext and then use the
request.setAttribute() call.
ServletContext newContext =
getServletContext().getContext(webApp);
     if( newContext == null )
throw new IllegalArgumentException("Invalid webApp
p '"+webApp+"' does not exist.");
request.setAttribute("myobject", objToPass) ;
RequestDispatcher dispatcher =
newContext.getRequestDispatcher(urlToGoTo) ;
dispatcher.forward(request, response);
Unfortunately those apps are on different servers ...

Similar Messages

  • Sending user data object to another application

    Hi All,
    I have an application which fetches user data from database and put in session later from one of the jsp page it has to go to another application where i need to pass an object that contains user session information along with its personal information.
    How can i do it if i want to avoid using Get() that displays parameters on the browser address bar. I mean to send the object instead of parameters.
    Please suggest.
    Thanks in Advance.

    You mean calling /appB/servletB from /appA/servletA ?
    There is an attribute of a webapp called "crossContext" and when set to true allows the request dispatcher to dispatch requests (nah, really?) to OTHER web applications, but AFAIK, it's not considered "a good thing".
    I'm sure someone else can elaborate on this. Personally I have never had to do that kind of stuff ;-)
    Hope it at least points u in the right direction ;-)

  • Passing Objects Between Web Applications

    Hello, I have a question in which I have posted in several different forums. I'm hoping that someone may be able to help me with this.
    I have a JSP "application" in which I several WAR files that contain different portions of the application. The logic is in place that each application is in separate WAR file for SCM. For the purpose of getting help, I will only concentrate on two different WAR files and a JAR file, which is located in the <TOMCAT_HOME>/lib directory.
    The JAR file contains a couple of classes which hold generic information that is used between all of the different subapplications.
    ASD.war: contains a couple of files for the master application that links different sub-applications that a user has access to. This WAR file is what is initially loading the JAR file with the information.
    * Login.html: Prompts user for username/password and forwards to login.jsp
    * Login.jsp: verifies that above is a valid database user and loads the JAR's class with relevent information and if so, loads up contents.jsp
    * Contents.jsp: shows a list of applications that the user has access to. It contains hyperlinks to different applications (WAR files).
    SCR.war: contains an application that tries to use the loaded variables/values from the JAR file supplied/populated by the ASD.war application
    * SCR_Role.jsp: contains the different roles in which the logged in user has priviledges to. It tries to utilize the username/password that was populated in the Login.jsp (ASD.war).
    The problem, of course, is that the reference to the JAR class doesn't exist for the SCR application. I have tried this with using static variables, which works. But of course this is not wise or pratical for a multi-user use of the application(s).
    Can anyone suggest things that I may try. Right now, I'm getting near to suppling an addition database table that will temporarily be populated with the username/password so that the sub-application can load and remove the record. This would work; I don't want these values being passed repeatedly throughout the life of the session, I would like to pass the reference to the object. By making the table, I would still run into problems whereas I want to pass non-string values to another application.
    Thanks for any help that you can provide.
    Jim

    I think that I may have found a solution... There might be a better way, and maybe this will be able to get someone else thinking about something related...
    Ok, I have my jar file which contains now loginInfo & a new staticLoginInfo. My loginInfo contains all of the instance variables; whereas the staticLoginInfo contains static references to the instance class.
    ASD.jar - staticLoginInfo.java:
    private static Vector reference = new Vector();
    public static int setUp(loginInfo login)
    int seq = reference.size();
    reference.add(seq,login);
    return (seq)
    public static loginInfo getLogin(String seq)
    return ((loginInfo)(reference.get(Integer.parseInt(seq))));
    Now I have a war file that contains contents.jsp which contains links to the different applications that the logged in user has access to.
    ASD.war - contents.jsp:
    seq = staticLoginInfo.setUp(login);
    <a href="/SCR/SCR_Role.jsp?seq=<%=seq%>">...
    Now my SCR.war file contains SCR_Role.jsp that shows different "roles" that that person has within the application...
    SCR.war - SCR_Role.jsp:
    loginInfo tLogin = (loginInfo)staticLoginInfo.getLogin((String)request.getParameter("seq"));
    login.setUsername(tLogin.getUsername());
    login.setPassword(tLogin.getPassword());
    login.setDatabase(tLogin.getDatabase());
    Believe it or not, this works. I thought that I would be able to just put login = (loginInfo)staticLoginInfo..., and this works for each page that I put this in; but by setting a temporary variable (tLogin), it carries throughout the rest of the application...
    Thanks for all the help for those that tried...
    Jim
    </a>

  • Best way To get data from another application using NDDE lbrary

    My vb.net application gets data from another application using NDDE Library. I got stocks prices (open,high,low,close,volume,change......(about 15 records for each stock)) (about 200 stocks) . I don't know if there is a problem in my code.
    This is my code:
    l : is the list of stocks.
    This Sub connects to server and requests the data :
    Public Shared Sub GetQuotes()
    Try
    client1 = New DdeClient(server, topic)
    client1.Connect()
    For i As Integer = 0 To l.Count - 1
    client1.StartAdvise("QO." & l(i).t & ".TAD$last", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$open", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$high", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$low", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$pclose", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$volume", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$date", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$time", 1, True, 60000)
    Next
    Catch ex As Exception
    MsgBox(ex.Message)
    End Try
    End Sub
    and then I get the data from Client_advise sub (called each time a value changed )and fill the list. What I know is that client advise gets only one record for single stock each time is called..
    Example: for stock AAPL. 1st time enters client_Advise I get open price for AAPL, 2nd time I get high price for AAPL,3rd time I get low price..... and I update the value in the List (l)
    This the client_Advise Sub:
    Private Shared Sub client1_Advise(ByVal sender As Object, ByVal e As NDde.Client.DdeAdviseEventArgs) Handles client1.Advise
    For q As Integer = 0 To l.Count - 1
    If l(q).t = w(1) Then
    Dim item() As String = e.Item.Split("$")
    If l(q).Open = "#" Then
    l(q).Open = "0"
    End If
    If l(q).hi = "#" Then
    l(q).hi = "0"
    End If
    If l(q).lo = "#" Then
    l(q).lo = "0"
    End If
    If l(q).Close = "" Or l(q).Close = "#" Then
    l(q).Close = "0"
    End If
    If l(q).pclose = "#" Then
    l(q).pclose = "0"
    End If
    If item(1) = "open" Then
    l(q).Open = Format(Val(e.Text), "0.00")
    ElseIf item(1) = "last" Then
    l(q).Close = Format(Val(e.Text), "0.00")
    ElseIf item(1) = "high" Then
    l(q).hi = Format(Val(e.Text), "0.00")
    ElseIf item(1) = "volume" Then
    l(q).Volume = Val(e.Text)
    ElseIf item(1) = "low" Then
    l(q).lo = Format(Val(e.Text), "0.00")
    ElseIf item(1) = "pclose" Then
    l(q).pclose = Format(Val(e.Text), "0.00")
    If l(q).pclose <> "" And l(q).pclose <> "#" And l(q).Close <> "" And l(q).Close <> "#" Then
    l(q).c = Format(l(q).Close - l(q).pclose, "0.00")
    l(q).cp = Format(((l(q).Close - l(q).pclose) / l(q).pclose) * 100, "0.00")
    End If
    l(q).flag1 = 2
    ElseIf item(1) = "date" Then
    l(q).Date1 = e.Text
    ElseIf item(1) = "time" Then
    l(q).Time = e.Text
    End If
    Exit For
    End If
    Next
    End Sub
    Am I doing something wrong which inreases CPU usage to 80 or 90 % ?
    Thanks in advance.

    Hi MikeHammadi,
    According to your description, you'd like to get data from another app using NDDE library.
    When using the NDDE library, the CPU usage is high. As the NDDE library is third-party library, it is not supported here. I suggest you checking if the problem is caused by the NDDE library.
    If you'd like to get data from another app. I suggest you could save the data in the dataBase, and then read it in another application if necessary.
    If you have any other concern regarding this issue, please feel free to let me know.
    Best regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Sending request object to another application

    Hi
    Is there any possibility to send request object from one Application context to another application context.
    We have two JEE enterprise application that deployed on different application server I want to know if there is any possibilty to send request object to them or not?
    I don't like to redirect reuqest because I want to put some value in req body (POST method)

    It is possible to get a request dispatcher to a servlet in another context by first getting the other context's ServletContext object. For example, in the original servlet's doPost method::
        ServletContext otherContext = this.getServletContext().getServletContext(uriToSecondContext);
        RequestDispatcher dispatcher = otherContext.getRequestDispatcher(uriToForwardTo)
        dispatcher.forward(request, response);In order to work both applications have to be configured to be allowed Cross Context access. In Tomcat you do this in the <Context ...> element of the configuration XML file by defining the crossContext attribute to "true".

  • Need to remove a sprite object when another sprite object hits it

    Hello All,
    I have a brick class where I have created a rectangle using flash.display.graphics.
    I am using this brick class to create a grid of 10 X 10 in another class called grid using new brick() in a for loop.
    I have another class called ball where I have created a circle with flash.display.graphics.
    The problem is that I want to remove / destroy individual bricks when the ball hits the bricks on Event.ENTER_FRAME which is not happening.
    the error I get is shown only for the last brick that is created in a for loop.
    ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
    at flash.display:isplayObjectContainer/removeChild()
    at grid/ball_movement()// my function in enter frame event
    The code I wrote in ENTER_FRAME is
    if (Ball.hitTestObject(bricks)) {
    removeChild(bricks);
    where
    var Ball:ball=new ball()
    var bricks:brick=new brick()
    any help is highly appreciated.
    thanks
    iceheros

    Thanks a lot Kglad for your help. But how can I check for the entire grid, this works but how to detect the hit for all the bricks in my 10X10 grid? It is currently removing only the last brick (element) =100 (10X10) when I form the grid.
    Thanks Again
    iceheros

  • GAME: best way to MOVE objects: tweenlite them or increment their x any values

    As the title says, need best way to move objects in game. Always used x and y increments. Read about tweenlite and use it, very easy. So which do I use taking into account that these games can be ported to mobiles ie: which is more optimized. It's a platform type game. I will have
    a. A little girl that walks and climbs
    b. Little platforms that slide from side to side - you have to jump on them
    c. The little girl will jump
    d. Little baddies will fly around the screen.
    ALSO, as the girl jumps I would like it to look natural
    a. Gravity as she falls down
    b. The correct increment on x and y as she jumps.
    Shouldn't their be an actionscript 3 games forum . anybody know a good site for that?
    Cheers in advance

    OK - I get the message. I should increment x.
    I must have phrased the question wrongly. I'm just looking at optimization techniques so when games go on mobile they work OK.

  • ExternalInterface: pass object reference across interface - how?

    I want to invoke methods on specific Javascript or
    ActionScript objects through calls across the ExternalInterface
    barrier. I would like to be able to do this either AS -> JS or
    JS -> AS.
    So I would like to pass an object reference across the
    interface. I'm not sure exactly what *is* getting passed (is it the
    serialized value of the object?), but it doesn't seem to work as an
    object reference.
    Here's a notional code sample. I have two symmetric object
    definitions, one in Javascript, one in ActionScript. During
    initialization, one instance of each object will be created and
    given a pointer to the other. Then they should each be able to
    invoke a method on the other to "do stuff".
    //----------[ code ]---------------------------------
    //--- Javascript ---
    class JSobj {
    var _asObj;
    JSobj.prototype.setASObj = function(obj) { _asObj = obj; }
    JSobj.prototype.callASObj = function(foo) {
    callASObjectMethod(_asObj, foo); } // does: _asObj.asMethod(foo);
    JSobj.prototype.jsMethod = function(bar) { /* do stuff */ }
    function callJSObjectMethod(obj, args) { obj.jsMethod(args);
    //--- ActionScript ---
    class ASobj {
    var _jsObj;
    public function set jsObj (obj:Object):void { _jsObj = obj;
    public function callJSObj (foo:Number):void {
    ExternalInterface.call("callJSObjectMethod", _jsObj, foo); } //
    does: _jsObj.jsMethod(foo);
    public function asMethod (bar:Number):void { /* do stuff */
    function callASObjectMethod (obj:Object, args) {
    obj.asMethod(args); }
    ExternalInterface.addCallback("callASObjectMethod",
    callASObjectMethod);
    //----------[ /code ]---------------------------------
    My workaround is to pass a uint as an opaque handle for the
    object, then resolve it when it is passed back. I'd rather pass a
    real reference if possible. Is there a way to pass object
    references between JS and AS?
    Thanks,
    -e-

    It's an object of a class that extends Object. I guess the answer is no then.
    Thanks for your answer

  • Best way to pass data sets to another program

    Hey
    I want to connect another (maths) program with my java application. Therefore I need to paste data (some kind of tab separated table) to this program.
    I try now to save these data in a separate newly generated file and to pass a command with Java's Runtime.exec() method to this program to read these data. Is this a good idea or might there be better ways?
    If I do so, is there a way in Java to generate some kind of a "temporary" file which will be deleted automatically after usage or is this nothing else than to save it in a common file and delete it afterwards. What's the best way to pass data generally?

    Well, the connection will not be over a network, so I'd rather think it's not a Socket or RMI problem (unless someone convinces me).
    Yes it's very external, it's a C or C++ written program, I don't have any source codes. So far I generated a file for Input command and data, I passed that on to the maths program and returned the output into another file.
    Now I would like to separate the output and like to obtain some tables and graphical things like charts at the output. Do I have to generate three different types of outputfiles? How to store some graphics e.g. some distributions. I thought even of generating a database. I never thought about XML, I don't know if this works for that kind of problem?!

  • Is there any way to pass value from one SWF to another ?

    I am doing project using flash, now I cant pass a value from one SWF to another, is there any way to pass value from one SWF to another.
    thanks

    Hi,
    Just to confirm here do you simply want to communicate between two SWFs without involving Flash Media Server. If this is the case one good way of doing it is to use a local connection. It can be used for direct communication between two separate instances of the flash player. However if you want to involve multiple clients sharing a common variable then you may have to use Shared Object for this. Please let me know what is the actual use case, is it multiple clients sharing a common variable or different player instances communicating between themselves.
    Thanks,
    Abhishek

  • ATTACHING one object to another - best way?

    Whats the best way to ATTACH one object to another in my 3D composition?
    For example, I have a circular logo which I am spinning and moving in 3D space. I want to attach a lens flare graphic to it at it's right edge.
    I will then animate the brightness of this lens flare for a few seconds.
    How do I make sure BOTH of these graphics are spinning and moving married together x,y,z all the time?
    Thanks,,
    Message was edited by: Bansaw

    Howdy,
    As Certified said, grouping multiple elements and animating the group is ideal, but as you pointed out, you often animate one object and only later decide to include more elements in the animation.
    You can copy and paste the keyframes/behaviors or drag-and-drop the animated channels from one object to the next, but that means having to update a bunch of elements every time you want to make a change. The best solution: the Match Move behavior (sound of trumpets).
    In addition to pixel-based tracking, Match Move can tell one object to simply match the transforms of another. It has two modes: attach and mimic. Attach basically nails the match-moved object to its source. Mimic has the match-moved object perform the same animation as the source. A movie that better shows the distinction can be found here.
    This works for position, scale and rotation transforms. By default, Match Move will set the next object down in the Layers List to be the source. Just drag and drop a new source (if need be) and you're good to go. Keep in mind that the behavior is overriding the targeted transforms channels on the object, so any other animation on those channels will be ignored. This is why doing the group thing is the most flexible.

  • So i got the update on my ipod touch 5th gen and when i got it it asked me for my old itunes acount and password, except i no longer have that info for the back up and it wont let me by pass at all, i need a way to just restart it

    so i got the update on my ipod touch 5th gen and i got asked me for my old itunes acount and password so i can get the back up from icloud, except i no longer have that info for the back up and it wont let me by pass at all, i need a way to just restart it

    You need to recovery and use it. Sounds like you are running into:
    iCloud: Find My iPhone Activation Lock in iOS 7
    Is there a way to find my Apple ID Name if I can't remember it?
    Yes. Visit My Apple ID and click Find your Apple ID. See Finding your Apple ID if you'd like more information.
    How do I change or recover a forgotten Apple ID Password?
    If you've forgotten your Apple ID Password or want to change it, go to My Apple ID and follow the instructions. SeeChanging your Apple ID password if you'd like more information.

  • How to pass a locale object into another function?

    Greetings,
    i like to pass a locale object into another function. These are my code below
    import java.util.*;
    public class Locales{
         public static void main(String[] args){
              Locale locale= new Locale("EN", "US");
              convert(locale);
    public void convert(Locale convert)
         String language = convert.getDisplayLanguage();
         System.out.println(language);          
    }I got this error:
    Locales.java:6: non-static method convert(java.util.Locale) cannot be referenced from a static content
                    convert(locale);
                    ^How do i correct it?
    Thanks

    Did you bother to do a search?
    Did you bother to read any of the material that the search would have linked you to?
    If you had then you would be able to understand where you are going wrong and how to fix it yourself. Instead of being spoonfed by us.

  • Yet Another "Passing Objects" Thread

    Hi All,
    Quick question about passing objects:
    I have three classes - ClassA, ClassB and ClassC. Lets say I create an object of ClassA in ClassB. Also, I would like to send the ClassA object from ClassB to ClassC to update its data. My question is, can I set the ClassA object in ClassC and modify it through ClassB? Confusing? I'll try to create an example below.
    ClassA:
    public class ClassA {
           // data
    } ClassB: creates and calls update methods for ClassA object
    public class ClassB {
           ClassA object = new ClassA();
           // print object
           ClassC ClassCFacade = new ClassC();
           ClassCFacade.setClassAObject(object);
           ClassCFacade.updateClassAObject(object);
           // print object
    }ClassC: updates object
    public class ClassC {
          // set object
          public void setClassAObject(ClassA object) {
                   // sets object
          // get object
          public ClassA getClassAObject() {
                  // returns object
          // modify object
          public updateClassAObject() {
                ClassA o = getClassAObject()
                // modify o
                setClassAObject(o)
    }So if objects are passed by reference, handle, or whatever you call it, essentially the above code should modify ClassA object created in ClassB, meaning the ClassA object should display it was modified after second print in ClassB. Although I've tried this implementation and the ClassA object is not modified after updateClassAObject method call from ClassB.
    Any input would be appreciated.
    Thanks,
    Bob

    OK. Here's snippets of actual code:
    public class ClassA implements SessionBean, ClassARemoteBusiness {
        // ClassA Attributes
        Integer ID;
        String name;
        // SET METHODS
        public void setClassAID(Integer ID) {
            this.ID = ID;
        public void setClassAName(String name) {
            this.name = name;
        // GET METHODS
        public Integer getClassAID() {
            return ID;
        public String getCLassAName() {
            return name;
    import classa.ClassA;
    import classc.ClassC;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class ClassB extends HttpServlet {
        private ClassA object;   
        private ClassC ClassCFacade;
        private ClassCFacade = lookupClassCBean();
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
              HttpSession session = request.getSession();           
              // display object values - displays default values
              out.println("ID: " +object.getClassAID());
              out.println("Name: " +object.getClassAName());
             // update object
             ClassCFacade.setClassAObject(object);
             ClassCFacade.updateClassAObjectID(someInteger);
             ClassCFacade.updateClassAObjectName(someName);
              // display object values - displays updated values
              out.println("ID: " +object.getClassAID());
              out.println("Name: " +object.getClassAName());
        // LOOKUP METHODS
        private web.ServiceLocator serviceLocator;
        private web.ServiceLocator getServiceLocator() {
            // service locator code
        private classc.ClassCRemote lookupClassCBean() {
            // lookup code       
    import classa.ClassA;
    public class ClassC implements SessionBean, ClassCRemoteBusiness {
        private ClassA o;
        // SET METHODS
        public void setClassAObject(ClassA object) {
            o = object;
        // UPDATE
        public void updateClassAObjectID(Integer ID) {
            o.setClassAID(ID);
        public void updateClassAObjectName(String name) {
            o.setClassAName(name);
    }

  • Is there any way to pass a webapp item ID number to the input form of another webapp?

    Context:
    I'm working with a group of members who are collaborating on research.  The idea is for one person to post information, and then have others build on it, including attaching files, images and hyperlinks (so a simple forum doesn't work...).
    If I could have the item ID from the main webapp be passed to the "child" webapp, all would be well.  I tried {tag_itemid} but of course, this didn't work.  I can display the item ID and have the users retype it into a form, but this isn't very streamlined...   Is there any way to pass the information directly to the form?
    Thanks!!
    Linda

    Simply make the child web app form part of one of the main web app's layout(s)/template. That way, when you use {tag_itemid}, it will be that of the main web app.

Maybe you are looking for

  • Problem while cloning From RAC to Non RAC

    Hi Can any body help me to solve this problem occured while cloning my RAC database of EBS 12.06 to Non RAC APPS Password : Log file located at /dump/rmsbkp/db/tech_st/10.2.0/appsutil/log/RMS_devmdb1/ApplyDBTier_03240738.log - 50% completed Determini

  • Updating of apps on a different account

    I've just bought a second hand MacBookAir and been down to my local Apple store who helped me wipe and re-load Mountain lion. however I'm trying to set it up and keep coming up against Iphoto and IMovie updates saying that they cannot be updated as t

  • Assign Operating Unit

    Hi, We need help; We define a new Accounting Rules in Account Receivable by following steps: Receivables: Setup >Transactions >Accounting Rules > In Form enter Name, Description, Type. But when you enter a Period, a message appears is "This Period do

  • Assigning multiple withholding tax codes of the same witholding tax type

    As described in note 363650, I have configured a withholding tax type FE to include a range of withholding tax codes of 0% for US 1099 reporting only. I also carried out the conversion to extended withholding and resolved all errors. My requirement i

  • User Exit regarding Sale Order

    Hi All, While creating a sale order, in the header details and in conditions tab. All the condition types are displayed. Customer requirment is i need to make some changes for some particular condition type in tht sale order like. Can any one pls tel