Can I pass serialized object as argument through WebStart?

I know I can pass argument through WebStart using <argument> element in the application-desc of the jnlp file.
Does WebStart support placing a Java serialized string inside the <argument> element? The reason is I want my application to behave differently based on the input object(s).
So my thinking is first to generate a serialized string form of my object , then place this serialized string inside the <argument> and then when my Application starts, maybe somehow Java deserializes it for me or may be I have to deserializes myself?
Is this possible?
Thanks
-ken

yes, you can. although I am not sure how long that string can be? what are you going to store in the string - what kind of information?
I would generally store configuartion parameters in a seperate file. You could pass the path to the config file in your arguments...

Similar Messages

  • How can I pass an object to a function by value?

    Hi
    I have a function with an argument. this argument is an object. I don't want to alter this object. But java passes this object by reference and some fields in this object are altered after function return.
    How can I pass this object by value and keep my original data unbroken?
    thanks for any help

    a.toraby wrote:
    I have a function with an argument. this argument is an object. I don't want to alter this object. But java passes this object by reference and some fields in this object are altered after function return.
    How can I pass this object by value and keep my original data unbroken?How you approach it is likely to depend on how much control you have over the code in question. If it's legacy code and has been badly designed, there's probably very little you can do to protect existing code short of a complete refactoring.
    What you could do as an interim measure is:
    1. Create an immutable wrapper to your existing mutable class.
    2. Create new methods that replicate the existing ones, but take the immutable class instead.
    3. Deprecate the old methods.
    This won't break client code, but they will now get warnings when they compile and you can add documentation to point them to the new class/methods.
    If you are in control of the code (especially if you're still in the design stages), you've got several options:
    1. As Dr.Clap says, make your class immutable (probably best).
    2. If this isn't possible, create mutable and immutable variants of your class. This is often best achieved by hanging them both from an interface.
    Winston

  • Can I pass an Object THROUGH to a LISTENER?

    I created a class called FuncSelect(), whose constructor takes a JDBCClass object as an argument.
    public FuncSelect( JDBCClass dbApp) {
    }Passing in this object allows FuncSelect() to reference JDBCClass's Session object and various methods.
    FuncSelect implements a listener, which in turn calls method postUpdate(), which needs to reference the dbApp.Session object -- however, I'm getting hung up trying to figure out how pass dbApp through to the listener:
        class OKListener implements ActionListener {
            public void actionPerformed(ActionEvent e ) {
                postUpdate() ;  // <--- need to pass dbApp to this method!!!!
        }Confused? Again need to pass dbApp object as follows:
    FuncSelect(JDBCClass dbApp) --> OKListener( ActionEvent e, JDBCClass dbApp) --> postUpdate(JDBCClass dbApp ).
    Do I need an abstract class for this? Any samples out there?
    Thanks for any assistance.

    There's nothing that says that your listener can't have more than just an actionPerformed method. Add a method (or a constructor) to your listener that accepts a JDBCClass object just like the FuncSelect class does.
    class OKListener implements ActionListener {
      private JDBCClass dbApp = null;
      public OKListener() { super(); }
      public OKListener (JDBCClass dbApp) {
        super();
        this.dbApp = dbApp;
       public void actionPerformed(ActionEvent e ) {
       postUpdate(dbApp) ;  // <--- need to pass dbApp to this method!!!!       
    }

  • How to pass serialized object and the string through the socket together?

    I have an application which listens on a port and I usually read string lines from it. Now I want to pass serialised object through it , plus I should indicate (using some string like "object coming") tht the following packet is a serialized object.

    Since Strings are serializable you could just send a stream of serialized objects then you don't have to know anything about the format.

  • Can we pass values to custom headers through HTTP bindings in BPEL?

    hi,
    I have an urgent requirement where I have to pass values to custom headers of HTTP url through HTTP bindings in bPEL.
    Is it possible? Say I have a http url http://localhost:80/test.
    I need to post xml over the above HTTP url as well pass some values to the Custom Headers Variables.
    Can I achieve this functionality thorugh BPEL or not?

    Hi,
    My requirement is exactly the same as yours, can you please let me know what did you do to overcome the Oracle Forms Default change password screen.
    Regards,
    Praveen

  • How can I pass an object to an inner method?

    Hi all,
    I'm stuck with a tiny problem here, hope someone can help out:
    I receive an UndoableEditEvent object in my method and I then want to apply that object to a JTextArea, my understanding is that I need to add a listener to the JTextArea.. but it won't see my UndoableEditEvent object.
          public static void edit( UndoableEditEvent e ) {
                final UndoManager undo = new UndoManager();
                Document doc = text_in.getDocument();
                doc.addUndoableEditListener(new UndoableEditListener() {
                public void undoableEditHappened(UndoableEditEvent e) {
                    System.out.println(e.getEdit());
                     undo.addEdit(e.getEdit());
    Any ideas?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Well, that looks like the right code for adding a listener to your JTextArea... except for the bit where the code is inside a static method that has an UndoableEditEvent as a parameter. Just get rid of that, and put the inside code immediately after the line of code where you create your JTextArea. You will probably have to make your UndoManager an instance variable of your class, too.

  • Passing serialized objects in a session.

    Hi,
    I am trying set a session by passing an arraylist as a parameter to it.
    The declartion goes like this:
    session.setAttribute("name", arlList.get(0)); The second parameter to setAttribute method needs to be serialized. Is the value arlList.get(0) serialized?
    Thanks.

    The second parameter to setAttribute method needs to be serialized.No, it needs to be Serializable.
    Is the value arlList.get(0) serialized?You mean Serializable? That depends entirely on what you put in it. If its Serializable it will be serialized. If it isn't Serializable you will probably get a NotSerializableException.

  • Passing serialized object and data as byte stream over same stream

    I am writing a chat program, I am keeping online user List as Vector A would like to pass online user List to client as Vector object also the client message is sended as byte stream. Is it possible to pass object and data as byte stream over the same stream.

    I am writing a chat program, I am keeping online user
    List as Vector A would like to pass online user List
    to client as Vector object also the client message is
    sended as byte stream. Is it possible to pass object
    and data as byte stream over the same stream.Why are you sending the client message as a byte stream?
    String seems a much more logical type. I would assume that you're reading strings from one client, and printing them on the others. If you translate to bytes in the middle, you're going to have to ensure that you decode those streams correctly on the other side.
    And if I were implementing this, I probably wouldn't send the raw Vector or List ... instead, I'd create a Message object, which wraps the Vector/String, and a MessageDispatcher interface, which the client implements to handle incoming messages.

  • Passing Business Object(Complex Type) as argument using PAPI-WS

    Hi All,
    Is it possible to pass Business Object or Complex Type as argument to process instance through PAPI-WS?
    As am getting error when am trying to pass business object in place of primitive type.. It would be great help any of you can provide example; if it is possible.
    Thanks & Regards,
    Ankur

    Hi Alexander,
    You are now able to create the Structure and set the cardinality also in NetWeaver CE.  I thin the following steps will be helpful for you.
    1. Create a CAF project called firstcaf.
    2.Create an entity service within the project called Customer.
    3. Now expand modeled.
    4. Then right click on Data Types. Here you will get the option "New Structure".
    5.Now select New Structure, One popup will appear then enter the Structure name called Address and click ok.
    6. Now You will get your Address structure under Complex Types.
    7.Double Click on Address. In right hand side you will get the Address structure for editing.
    8.Now from left hand side(Existing Type) expand caf.core and add your required attribute. In right hand side (structure Field) you can edit the name of attribute. suppose for Address structure I have added two field phone and mobile (both are short text ). save it.
    9. Now switch to Composite Application Explorer and expand Business Objects ->Customer -> Customer->Customer. and double click on it (Customer).
    10. In right hand side expand project firstcaf ->modeled. Now you will get your structure here, In my case I will get Address structure. Now select your structure and  click Add button. Structure will go to right hand side(Structure Fields).
    11. If you want to change the cardinality it is very simple. Select The Structure from right hand side(Structure Fields) and in bottom side click on property. Now you will get the Cardinality field. you can change it as you like.
    Thanks and Regards
    Chandan

  • The Proper way to go - Passing Serialized Java Objects vs. Web Services?

    The team which I am apart of in our little "community" is trying to convince some "others" (management) that we should not use web services to communicate (move large data) within the same application (allbeit a huge application spanning across many servers).
    Furthermore these "others" are trying to tell us that in this same application when two small apps. inside of this large app. are both java we should not communicate via serialized java objects but instead we should use Web Services and XML. We are trying to convince them that the simplest way is best.
    They have asked us to provide them with proof that passing serialized java objects back and forth between two smaller java applications inside of a larger one is an Industry Standard. Can anyone help either straighten my fellow workers and I out or help us convince the "others" of the proper way to go?

    When I was a consultant we always gave the client what they wanted. Even if it was the wrong choice. Suck it up.
    I'm glad I wasn't one of those customers. Although I agree that a customer is the one who decides what to do, when I pay someone for consultancy, I expect them to consult me. If they know I'm trying to do something that I shouldn't be doing, I expect a good consultant to be able to show me that there's a better way (not just tell me I'm not doing it right, mind you).
    We pass a lot of data using XML and we don't have any transmission or processing speed issues.
    Then you either have a much better network than our customer did, or we're not talking about the same amounts of data here.
    I used the JAX-RPC RI ...
    That's cool... our customer was, unfortunately, infected with Borland products, so we had to use BES. The web services on BES were run by Axis.
    How large were these messages?
    Huge... each element had about 15 attributes, so 1,200 elements would require 19,200 XML nodes (envelope not included). By comparison, the serialized messages weren't even a quarter that size. It's not just about what you send across the network; it's also the effort of parsing XML compared to desrializing Java objects. Our web service wasn't exactly the only process running at the server.
    Anyone who understand the fundamental difference between ASCII (XML) and binary (serialized) formats realizes that no web service can possibly achieve the performance of binary Java services. Why do you think that work is being put into binary web services? I'm not saying XML is never a good thing; just that it's not The Holy Grail that a lot of people are making it look like.
    http://issues.apache.org/jira/browse/AXIS-688
    Ouch.

  • Passing argument through EL

    I was wondering if its possible to pass an argument through an EL expression. Specifically I was wondering if I could use #{Foo.bar("something")} as an attribute for a tag? I know that it won't work as written (I've tried it) but you can get the idea of what I'm trying for.
    What I don't want is to have to have a special method for each variation of how I might determine the value. I know its possible to have:
    #{Foo.barSomething}
    #{Foo.barSomethingElse}
    But in these cases, the method is no argument and the method name distinguishes them.
    TIA,
    sean

    Looking back at the component I created, I realized that what I was doing wasn't really standard EL anyway, so why not make things really elegant? I therefore combined property-value and method-value expressions, and then used normal Java method parentheses to differentiate the two. Revising the two examples from yesterday (and keeping the same backing bean method) yields:
    <gw:assignment var="test1" expression="#{'success'}"/>
    <html:outputText value="#{test1}"/>and
    <gw:assignment var="test2" expression="#{presence.concat(#{'suc'}, #{'cess'})}"/>
    <html:outputText value="#{test2}"/>Oh, but I'm not finished! How about this?
    <gw:assignment var="test3" expression="#{presence.concat(#{'suc'}, #{presence.concat(#{'ce'}, #{'ss'})})}"/>
    <html:outputText value="#{test3}"/>Infinitely nestable parameters, using both property values and method values. You like? I call it "extended EL."
    Now to stir up some controversy: Having an extra assignment step is still too much needless overhead. I'm going to go through and reimplement many of the common JSF tags (such as h:outputText) and retrofit the "value" attribute so that it handles extended EL.
    Normally I'm the first to jump on the standards/consistency bandwagon, and I'm a loud and long champion of doing things according to common specifications even if you lose just a little in functionality or efficiency. In this case, however, the JSF EL is amazingly deficient (I'm not the only person ranting about parameter passing), to the point that it's hard for me to implement normal functionality, as I mention earlier on this thread. Besides, using an extended EL in the attribute of my own component extension is really equivalent to using an existing JSF component combined with my custom assignment component, the latter of which uses an extended EL anyway.
    What makes this whole story so sad is that I'm at a loss to explain why parameter passing was not included in JSF EL from the beginning. The API already allows parameters in method-binding---the EL syntax simply doesn't provide access to this.
    Worse still (and contributing to the problem) is that the JSF expression language API is ill-designed. JSF EL only recognizes method-signature binding and does not include method-value binding. The former binds to the method itself, similar to a function pointer in C++ or a reference to a method in Delphi. The latter binds to the result of a method invocation, just as what JSF calls "value binding" does with the result of invoking a getter or setter method. (Note that "value binding" really uses "method-value binding" in the background once it finds the appropriate getter or setter method.)
    Let's take the <h:commandLink actionListener="#{backingBean.listener}"> attribute value, for instance. Here true method-binding is at work---JSF does not invoke the method indicated in the value of this attribute when the component is rendered---the method is the value of the attribute. (Note that the JSF EL is short-sighted here. It doesn't allow indication of parameters because it knows the method signature---but what about in the future when we want to differentiate among methods with the same names but different signatures?) Simarly the <h:commandLink action="#{backingBean.doAction}"> keeps a reference to the actual bean method and invokes it later when the command button is clicked by the user, although at this point JSF EL starts to conflate the distinction and actually uses the result of the invocation as if it were literally included as the original attribute value.
    My extended EL implementation, on the other hand, recognizes both property-value binding and method-value binding, the latter of which is absent from JSF EL. For each of my custom components from now on, the "value" attribute will accept a literal value, a property-value binding, or a method-value binding. The method-value bindings will accept parameters, each of which can be a property-value-binding or a method-value binding. (Maybe I'll throw literal parameter values into the mix later on, but that's really the least of my worries.)
    What should JSF do? First, it should add parentheses back into the EL for methods, and deprecate method binding and method-value syntax that do not have parentheses. Next, it should refactor ValueBinding to be an interface or abstract parent class of two new classes: PropertyValueBinding (equivalent to the existing ValueBinding) and MethodValueBinding (equivalent to the existing MethodBinding if it implemented a ValueBinding interface or derived from ValueBinding).
    All the existing createValueBinding() methods will then create the appropriate ValueBinding instance based upon whether a propert-value binding or method-value binding is being represented. Suddenly, all JSF components (yes, even the custom components that you've already created) will not only be aware of property-value and method-value invocation, they will all support nested method parameters.
    Yes, it's that simple. I know because I'm the new happy owner of my first of many components that support extended EL---something that should have been part of standard EL from the beginning.
    Now back to my regularly-scheduled application building...
    Garret

  • Can i pass parameters in calling an action through JS/VBS?

    Hi all,
    How can i pass arguments in calling an action through VBS?
    I have to find any set of fonts & replace with any another set of fonts.
    Im trying to do this in action.How can i pass paramaters?
    myRiaz

    i too want the same..
    how to do that ?
    thanks
    subha

  • How can I pass arguments from one MIDlet to another MIDlet

    Hi everybody !
    Can anybody help me in knowing that how can I pass the parameters from one
    MIDlets to another one in same application.
    I am devloping a application in which I am using more than two MIDlet and I
    want to transfer Parameter from one MIDlet to another one.
    I just explain what I have done....
    I made a MIDlet "A" and "B" in the same project using NetBeans IDE.
    In MIDlet "A" I create the Object of MIDlet "B" so that the constructor of
    MIDlet "B" is called and parameter can be transferred.
    But when I run the program it shows me two MIDlet on the screen, that I
    doesn't need.
    Suggestion are most welcome....
    Thanks in advance
    Regards
    Bhagwat

    If you create two MIDlet in a midlet suite, it will display as you mentioned means you can't change the display style.

  • Can we pass value through "EXPORT" in background scheduled report

    hi experts
          my query is can we pass some field using 'EXPORT' statement while scheduling a report to run in background using statement
    submit 'ZXYX' via job jo_name number jo_num and return.
    i am using 'IMPORT" statement in 'ZXYZ'

    EXPORT, as I recall, is limited to your user context.   Check shared objects (which still may not work, although you can propagate to servers) and INDX-like tables.  Research use of INDX-like tables for how data is passed into and out of these tables (import/export).

  • Can we pass objects to pl/sql block

    hi,
    can we pass objects to pl/sql block.i think we can.how to pass it.help me in getting the examples of "passing objects to pl/sql block"

    What exactly do you mean ? You can pass objects like any other parameters
    into and out from procedures/functions:
    SQL> create or replace procedure get_object(myobj in out nocopy my_obj)
      2  is
      3  begin
      4   dbms_output.put_line('ID : ' || myobj.empno);
      5   dbms_output.put_line('Salary : ' || myobj.sal);
      6   dbms_output.put_line('Department : ' || myobj.deptno);
      7   myobj.sal := myobj.sal*2;
      8  end;
      9  /
    Procedure created.
    SQL> declare
      2   mo my_obj := my_obj(1,1000,10);
      3  begin
      4   get_object(mo);
      5   dbms_output.put_line('New salary : ' || mo.sal);
      6  end;
      7  /
    ID : 1
    Salary : 1000
    Department : 10
    New salary : 2000
    PL/SQL procedure successfully completed.Rgds.

Maybe you are looking for