How to deliver parameter between applets

Suppose that there is an applet named A, can it deliver some
parameters to another applet B?
Thanks in advance!

If you are using Sun's JDK (Java plugin), then you should take a look at the Java Plugin Developer Guide on this site.
There are a few chapters devoted to Java-to-Javascript and JavaScript-to-Java communication. I haven't tried these myself, but it sounds promising. I guess it's possible that the Java in MSIE already supports this, I really don't know.
There is also a chapter on Applet Persistence API. This is supposed to be some way of storing and retrieving information. I don't really know how it works and it may not fit your situation, but it's worth looking into.
Another possibility ... if the browser runs the applets within the same JVM, you could have a static class which functions as a "directory" -- each applet registers itself with this class and uses this class to look up other applets.

Similar Messages

  • In jsp file, how to transfer parameter between two javabean?

    In jsp file, how to transfer parameter between two javabean?
    for example
    Bean1 has a attribute A
    Bean2 has a attribute B
    how to transfer the value of A to B

    Have you tried something like...
    <jsp:setProperty name="Bean2" property="B" value="<jsp:getProperty name="Bean1" property="A" />" />

  • How to deliver variable between jsp and EL ?

    this is the code of my *.jsp
    <%
    int g_nAge=12;
    %>
    ${g_nAge}
    I suppose that "12" is showed in my web-page,but actually I see nothing.
    This is an example in my jsp book showing the delivering variable between JSP and EL !
    how can it do that ?

    EL cannot pick up scripting variables. It picks up attributes from scope only.
    Similarly it doesnt set any scripting variables too.
    <%
                  int g_nAge=12;
                  pageContext.setAttribute ("g_nAge", new Integer(g_nAge));
    %>
    ${g_nAge}cheers,
    ram.

  • How can I distinguish between applets from the servlet end??

    What I'm looking for is just a way to distiguish between one applet from another on the servlet side. I know the session name and id will be helpful in this case. I was wondering, can I get the name of the client applet(Ex: appletClientOne or appletClientTwo) so that I can keep track of which messages to send to specific applet.

    Yes. Store the name of the applet in a cookie or HTML hidden input tag. Your other option is to connect to different URL's on your Servlet. Finally, you could use a combination of the above, and then set which applet a user is using in his/her HttpSession.
    - Saish

  • How to pass parameter between two jsp pages using web link (not form)

    Hi Friends,
    I have two jsp pages and would like to pass a parameter from one JSP page (one.jsp) to another JPS page (two.jsp)
    in one.jsp
    <a href="two.jsp?ant="<%=ant%">"> <%=antName%> </a><br>
    I don't know how to pass value of parameter "ant" to two.jsp from one.jsp.
    Can anyone help this? Thank you in advance</a>

    Looks like you've got it almost right - just an extra unneeded "
    <a href="two.jsp"?ant=<%= ant %>"><%=antName%></a>
    which should render on the page as something like
    My Ant Task
    When you click the link, it should pass that parameter, and you can get it via request.getParameter().

  • How to pass values between applet and jsp

    I have a jsp calling an applet which needs to return value to the calling jsp based on the action. Once the applet returns value to the calling jsp, I need to put that value into the session so that I can use it for the other pages. Could anyone have suggestion how to do it. I am new to applet development. Appreciate your help.

    Why does it have to send the value back via the same JSP? Why not create a servlet to take input from the applet?

  • Passing Parameter between Methods

    I have some problems because i don't really know how to pass parameter between methods in a java class.
    How can i do that? below is the code that i did.
    I want to pass in the parameter from a method called dbTest where this method will run StringTokenizer to capture the input from a text file then it will run storeData method whereby later it will then store into the database.
    How can i pass data between this two methods whereby i want to read from text file then take the value to be passed into the database to be stored?
    Thanks alot
    package com;
    import java.io.*;
    import java.util.*;
    import com.db4o.ObjectContainer;
    import com.db4o.Db4o;
    import com.db4o.ObjectSet;
      class TokenTest {
           private final static String filename = "C:\\TokenTest.yap";
           public String fname;
         public static void main (String[] args) {
              new File(filename).delete();
              ObjectContainer db=Db4o.openFile(filename);
         try {
            String fname;
            String lname;
            String city;
            String state;
             dbStore();
            storeData();
         finally {
              db.close();
         public String dbTest() {
            DataInputStream dis = null;
            String dbRecord = null;
            try {
               File f = new File("c:\\abc.txt");
               FileReader fis = new FileReader(f);
               BufferedReader bis = new BufferedReader(fis);
               // read the first record of the database
             while ( (dbRecord = bis.readLine()) != null) {
                  StringTokenizer st = new StringTokenizer(dbRecord, "|");
                  String fname = st.nextToken();
                  String lname = st.nextToken();
                  String city  = st.nextToken();
                  String state = st.nextToken();
                  System.out.println("First Name:  " + fname);
                  System.out.println("Last Name:   " + lname);
                  System.out.println("City:        " + city);
                  System.out.println("State:       " + state + "\n");
            } catch (IOException e) {
               // catch io errors from FileInputStream or readLine()
               System.out.println("Uh oh, got an IOException error: " + e.getMessage());
            } finally {
               // if the file opened okay, make sure we close it
               if (dis != null) {
                  try {
                     dis.close();
                  } catch (IOException ioe) {
                     System.out.println("IOException error trying to close the file: " +
                                        ioe.getMessage());
               } // end if
            } // end finally
            return fname;
         } // end dbTest
         public void storeData ()
              new File(filename).delete();
              ObjectContainer db = Db4o.openFile(filename);
              //Add data to the database
              TokenTest tk = new TokenTest();
              String fNme = tk.dbTest();
              db.set(tk);
        //     try {
                  //open database file - database represented by ObjectContainer
        //          File filename = new File("c:\\abc.yap");
        //          ObjectContainer object = new ObjectContainer();
        //          while ((dbRecord = bis.readLine() !=null))
        //          db.set(fname);
        //          db.set(lname);
        //          db.set(city);
            //          db.set(state);
    } // end class
         Message was edited by:
    erickh

    In a nutshell, you don't "pass" parameters. You simply call methods with whatever parameters they take. So, methods can call methods, which can call other methods, using the parameters in question. Hope that makes sense.

  • Passing parameter between two applets

    hi all,
    i want to pass parameter between two applets. in other words, when user clicks the button; close the running applet, pass parameter to another applet and run another applet.
    now i think that could be, ( creating a parameter table in database, when user click on button write parameters to table and stop active applet and run other applet. when other applet runs in init methot it takes parameter from table). but it will be very indirect way.
    if you have an idea or information, plesae tell me.
    thanks for your interest

    Hi ,
    Plz pay a visit to this wonderful website,
    http://www.rgagnon.com/javadetails/java-0022.html / http://www.rgagnon.com/howto.html
    Best Wishes,
    Gaurav
    PS : Thanks to Real Gagnon. This is all I can do at this stage, but wanted to say you are doing a wonderful job.

  • Can you please tell me how can i change the parameter of Applet using Aspec

    Respect Members
    Can we apply Aspectwerkz on Applet? In our project we have to
    change the method parameters before its execution(Around Advice) , can we do this in applet using Aspectwerkz?
    Can you please tell me how can i change the parameter of Applet using Aspectwerkz or AspectJ ?
    I did it by for Java Application using the AspectJ And Aspectwerkz But not able to do for Applet.
    For Applet I Am setting the parameter in JAVA plug in for Aspectwerkz e.g. -Xdebug -Xrunaspectwerkz -Xbootclasspath & path for xml file in which pointcut is defined.
    If you any Friend working on it or any author who might be helpfull for me please Forward this mail to him/her
    THANKs in Advance
    [email protected]

    hello rodale, what you're seeing is probably a side effect of firefox not being able to save certain preferences into its profile folder.
    go to ''firefox > help > troubleshooting information'', click on ''profile folder/show folder'' and close all firefox windows afterwards. a windows explorer window should open up - in there delete the file named '''user.js'''.
    in case this didn't solve the issue yet please also refer to [[How to fix preferences that won't save]].

  • How to establish communication between dynpro and Applet running in Portal

    Hello SDN,
    I have a problem with concept of my app and would be glad if You can help me. 
    -  I needed a graphics engine to draw a map during a dynpro runtime, and i made applet for it because dynpro don't offer suitable api.
    Map have to show some data from Bussines Warehouse and R/3 and also have to return coordinates onMouse click to dynpro app.
    My question is how to pass params from web dynpro app to applet and receive coordinates after mouse click on map.
    I made dynpage and placed my applet inside for EPCF but don't know how to use it in applet?

    1. First of all set up the Rfc connection between System A and System B.
       If you are calling the function module which is avlaible on Syetem A  and calling in system B. In system A, go to SM59 opt for R\3 connection and give all the details in "Technical settings" and "logon & Security" tabs and test your connection. If you are returning any value Back to system A , make the same settings in system B.
    2. While creating the Function module check the Radio-button "Remote-Enabled Module" in the attributes tab.
    3. Call function <function-name> Destination <Destination-name>.

  • URGENT HELP IS NEEDED!!!!!! How can i get two applet to communicate via a j

    I am writing a program that should allow me to communicate between applet. The applet is loaded via the a web site, but i can't get that to work, so i am using appletviewer instead.
    I want to establish a connection between the applets thus allowing to chat.
    So far i can open both applets up, (using localhost), but the applet isn't able to establish the connection and i have to turn off one of the applet window, before i get a connection, but it won't do anything after that.
    I know it is a security problem, but how can i fix this problem.
    Please can you help, i am in difficult position
    Junaid

    I think what u are trying to do is some peer-to-peer communication using applets.
    The thing is the applet knows ( via getCodeBase and getDocumentBase methods) from where it was launched. It has no knowledge of where other applets from the same server may be residing.
    It looks to me that you will need to do some server-side coding as well..
    On possible solution would be to
    A) Install and run a Tomcat Server
    B) Tomcat can be used as a webserver in limited way .. (refer it documentation ) by defaul it runs on port 8080
    C) So you can say http://localhost:8080/
    D) Use this launch the applets
    E) Using HTTP Tunneling ( Read about it in Servlets ) you can set up Tomcat to broker messages between the 2 applets
    Also from you question it appear that both the applets try to hook on the same port, now on one computer (localhost) one port can be used by one socket . Try to get them to use different ports then the appletviewer problems should solve it self.
    To use different ports without making 2 different applets , simeply pass the port as a PARAM to the applet

  • Passing data parameter between SWF files

    Hello Xcelsius Gurus,
    Is it possible to pass data parameter between SWF files?
    If possible, how to achieve it?
    Thank you.
    Justine

    Hi,
    Thank you for the reference.  Little bit confused, please let me clarify. 
    I do not understand how the receiver SWF receieved the data parameter and process.
    For example, I have a parent dashboard and a child dashboard.  In the parent dashboard, I have set up combo box to filter the data.  And I want the data that I have selected in combo box to the child dashboard.
    To do this, first I need to setup the flash variable at the parent dashboard to fetch the data I selected.
    After this, how to link this data to the child dashboard?
    Furthermore, after the child dashboard received the data parameter, I need this data to insert into the spreadsheet so I can filter the data.  Is this possible?
    Thanks.
    Edited by: Justine Liu on Jan 19, 2010 3:11 PM

  • Code sharing between applets

    Hi,
    I'm currently using Eclipse and JCOP plugin for applet development, and I'm looking for solutions on how to share custom libraries between applets. I'm particularly not looking for interface sharing between applets, but more how to organize the source code so I can include common custom classes in different applets (e.g. generic ASN1 parsing library, signature library etc)
    Thank you for any feedback.

    Thanks for the pointer! I also found this thread:
    https://forums.oracle.com/thread/2217928?start=0&tstart=0
    which cover the same topic with code examples to be very useful.
    But I have stumbled upon a couple of problem wrt this approach which I can't quite isolate:
    1. I've got a shell script which basically "tags" a package before build with the SVN version number, and if there are local modifications. This code is auto-generated in a file called svnversion.java inside commonlib package:
    package commonlib;
    public class svnversion {
      public static final byte[] TAG = {(byte) 0x00 ,(byte) 0xFB ,(byte) 0x3F } ;
      public static final boolean MODIFIED = true ;
    When this code was in the same package as the applet, I had no problem accessing the TAG byte array, but after separating the applet and the commonlib in two separate packages, I get SW 0x6f00 whenever I touch the TAG byte array from my applet. I can access the MODIFIED variable, but not the TAG byte array.
    (EDIT: Since commonlib declare TAG as a static final byte array, and final cannot be set to null upon release, maybe this is the cause for my memory leaks?)
    2. I try to keep everything in commonlib static, and I've added an install() and release() hook in commonlib which keeps track of reference counter and acquire and release memory. Upon release I set every static variable to null. And I call commonlib.install() from the applet, and use AppletEvent and do commonlib.release() upon uninstall. But still it seems I fail to clean-up properly, because I end up in situations where I'm unable to delete the card content - presumably because a memory leak. So I have a few questions related to that:
    a) How do I debug memory leaks?
    b) In commonlib, if I do:
    public class Common {
         private static DESKey des1Key = null;
         private static short refCount = 0;
         public static void install() {
              refCount++;
              if (des1Key == null)
                   des1Key = (DESKey) KeyBuilder.buildKey(KeyBuilder.TYPE_DES, KeyBuilder.LENGTH_DES, false);
    public static void release() {
         --refCount;
         if (refCount == 0)
              des1Key = null;
    Is it a correct assumption that I need to set des1Key to null, because it is declared as static?
    c) Does the following code snippets allocate memory, which needs to be freed?
    md = MessageDigest.getInstance(MessageDigest.ALG_SHA_256, false);
    and
    rsaCipher = Cipher.getInstance(Cipher.ALG_RSA_NOPAD, false);
    d) Say commonlib should hold one RSA key, but at install time we do not know the key size (actual size shall be requested by client). I chose this approach:
    public class RSAlib {
         public static KeyPair rsaKeyPair = null;
         public static Cipher rsaCipher = null;
    private static short refCount = 0;
         public static void install() {
    refCount++;
              if (rsaCipher == null) {
                  rsaCipher = Cipher.getInstance(Cipher.ALG_RSA_NOPAD, false);  }
         public static void release() {
              --refCount;
              if (refCount==0) {
                   rsaCipher = null;
                   rsaKeyPair = null;
    public static void createRSAKeyPair(short keySize) {
         switch(keySize) {
         case (KeyBuilder.LENGTH_RSA_1024):
         case (KeyBuilder.LENGTH_RSA_2048):
              break;
         default:
              ISOException.throwIt(SW.CRYPTOGRAPHIC_ERROR);
         try {
              JCSystem.beginTransaction();
              rsaKeyPair = new KeyPair(KeyPair.ALG_RSA_CRT, keySize);
              JCSystem.requestObjectDeletion();
              JCSystem.commitTransaction();
         } catch (Exception e) {
              JCSystem.abortTransaction();
    Is this correct usage of garbage collection (I know my JCOP card support it), and will this work in context of a commonlib?

  • Passing parameter to Applet Dynamically

    Hi All,
    How can i pass the parameter to applet at the runtime?
    I want to play a video file. So 'm using one applet(I got this from JMF Documentation).
    Here is the Applet._
    import java.applet.Applet;
    import java.awt.*;
    import java.io.File;
    import java.net.URL;
    import java.net.MalformedURLException;
    import java.io.IOException;
    import javax.media.*;
    import javax.swing.JOptionPane;
    public class TypicalPlayerApplet extends Applet implements ControllerListener
    // media player
    Player player = null;
    String mediaFile = null;
    // component in which video is playing
    Component visualComponent = null;
    // controls gain, position, start, stop
    Component controlComponent = null;
    // displays progress during download
    Component progressBar = null;
    * Read the applet file parameter and create the media
    * player.
    public void init()
    setLayout(new BorderLayout());
    // input file name from html param
    //String mediaFile = null;
    // URL for our media file
    URL url = null;
    // URL for doc containing applet
    URL codeBase = getDocumentBase();
    // Get the media filename info.
    // The applet tag should contain the path to the
    // source media file, relative to the html page.
    if ((mediaFile = getParameter("FILE")) == null)
    Fatal("Invalid media file parameter");
    try
    // Create an url from the file name and the url to the
    // document containing this applet.
    if ((url = ((new File(mediaFile)).toURI()).toURL()) == null)
    Fatal("Can't build URL for " + mediaFile);
    // Create an instance of a player for this media
    if ((player = Manager.createPlayer(url)) == null)
    Fatal("Could not create player for "+url);
    // Add ourselves as a listener for player's events
    player.addControllerListener(this);
    catch (NoPlayerException ex)
    JOptionPane.showMessageDialog(null, "Error "+ex.getMessage());
    catch (MalformedURLException u)
    Fatal("Invalid media file URL!");
    catch(IOException i)
    Fatal("IO exception creating player for "+url);
    * Start media file playback. This function is called the
    * first time that the Applet runs and every
    * time the user re-enters the page.
    public void start()
    // Call start() to prefetch and start the player.
    if (player != null) player.start();
    * Stop media file playback and release resources before
    * leaving the page.
    public void stop()
    if (player != null)
    player.stop();
    player.deallocate();
    * This controllerUpdate function must be defined in order
    * to implement a ControllerListener interface. This
    * function will be called whenever there is a media event.
    public synchronized void controllerUpdate(ControllerEvent event)
    // If we're getting messages from a dead player,
    // just leave
    if (player == null) return;
    // When the player is Realized, get the visual
    // and control components and add them to the Applet
    if (event instanceof RealizeCompleteEvent)
    if ((visualComponent = player.getVisualComponent()) != null)
    add("Center", visualComponent);
    if ((controlComponent = player.getControlPanelComponent()) != null)
    add("South",controlComponent);
    // force the applet to draw the components
    validate();
    else if (event instanceof CachingControlEvent)
    // Put a progress bar up when downloading starts,
    // take it down when downloading ends.
    CachingControlEvent e = (CachingControlEvent) event;
    CachingControl cc = e.getCachingControl();
    long cc_progress = e.getContentProgress();
    long cc_length = cc.getContentLength();
    // Add the bar if not already there ...
    if (progressBar == null)
    if ((progressBar = cc.getProgressBarComponent()) != null)
    add("North", progressBar);
    validate();
    // Remove bar when finished ownloading
    if (progressBar != null)
    if (cc_progress == cc_length)
    remove (progressBar);
    progressBar = null;
    validate();
    else if (event instanceof EndOfMediaEvent)
    // We've reached the end of the media; rewind and
    // start over
    player.setMediaTime(new Time(0));
    player.start();
    else if (event instanceof ControllerErrorEvent)
    // Tell TypicalPlayerApplet.start() to call it a day
    player = null;
    Fatal (((ControllerErrorEvent)event).getMessage());
    void Fatal (String s)
    // Applications will make various choices about what
    // to do here. We print a message and then exit
    System.err.println("FATAL ERROR: " + s);
    throw new Error(s); // Invoke the uncaught exception
    // handler System.exit() is another
    // choice
    Following is my HTML Code,_
    <applet id="TypicalPlayerApplet" name="TypicalPlayerApplet" code="TypicalPlayerApplet.class" codebase="app" width=320 height=300>
    <param name=file id="param1" value="c:\\avi\\cineloop1.avi" />
    </applet>
    What my question is how can i pass this location "c:\\avi\\cineloop1.avi" at the runtime. I am passing the cineloop location along with the URL. Now i want to pass this location which is taken from the URL, to the Applet.
    How can i achieve this. Will some one help me out.
    Thanks and regards
    Chennaibee.

    Thanks winj,
    I tried to pass the cine loop filename via java script on page load event.
    function assignit()
    var filename='c:\\avi\\loop3.avi';
    var myapplet = document.getElementById('TypicalPlayerApplet');
    myapplet.mediaFile=filename;
    And in the page load event i called this JS.
    *<body onload='assignit();'>*
    It's passing the file name after the applet getting started.
    How can i pass the file name before the applet getting starts.
    Is it possible to call this Java Script during the page initialization.
    Regards
    Chennaibee.

  • Communication between Applets & Servlets

    How do you communicate in between Applets & Servlets ?

    http://forum.java.sun.com/thread.jsp?forum=45&thread=525518&start=0&range=15#2519429

Maybe you are looking for

  • How can we split the grid display in alv reports.

    hi everyone.i am trying to get the display of two reports in a single one using split screens.i had written a report for vendor balance.one for open and one for cleared items.how can i combine these two reports. the field catalog was same for these t

  • Win 7 OS Re-install (HP Pavilion dv6 Entertainm​ent Notebook PC series)

    Hi I have problem re-install windows 7 on the laptop. I installed Linux on the computer. and want to re-install windows 7 on it. but have problem finding the right AMD Sata driver for my laptop. when i use lspci -vl in ubuntu i get that i have AMD SB

  • How to find the extraction method of a datasource?

    Hi, On a review of some documents on SDN, regarding how to track where data is coming from to BW, there was this helpful quote. “Just knowing what is the extraction method of a datasource and our search of the origins achieves a vast improvement!”  S

  • I need to use Windows Small Business Server.  Any ideas?

    I need Internet Explorer in order to use Windows Small Business Server.  Since that isn't available for Mac are there any other options?

  • Javabean exception frm-92100

    Hi, can anyone help? I have a web-deployed form with a bean. The bean is derived from an example class posted in metalink as note 130431.1 "How to Read Local Files Using Web Deployed Forms? A step by step guide." I'm running forms 6i version 6.0.8.24