Activate a Midlet from an Applet

Hi,
I am trying to activate a Midlet from an Applet? Is this possible in any of the latest J2ME releases?
Using SATSA I am able to send APDU commands from the Midlet to the Applet and start a scenario where my Applet and Midlet exchange information.
Is this available in the opposite direction. I want that my Applet, when triggered by an event, be able to Activate\Wake Up the Midlet.
I am a newbie to J2ME and after researching the web, still couldn't find an answer. Thanks for your help.
Bye.

You can communicate with servlet from an applet, using URL connection, and then send POST/GET methods through HTTP protocol, here is a code snippet,
// applet side, this method will send a POST method to the servlet and then get url openstream to read a
// returned object from the servlet, params should be in the form param1=value&param2=value etc...
public Object getObjectFromServlet(String servletName,String params) {
    Object object = null;
    try {
      URL url = new URL(codeBase,
                        contextRoot + servletName + params);
      URLConnection con = url.openConnection();
      con.setUseCaches(false);
      InputStream in = con.getInputStream();
      ObjectInputStream result = new ObjectInputStream(in);
      object = result.readObject();
      result.close();
      in.close();
    catch (ClassNotFoundException ex) {
      System.err.println("ClassNotFoundException caught:" + ex.getMessage());
    catch (MalformedURLException ex) {
      System.err.println("MalformedURLException caught:" + ex.getMessage());
    catch (IOException ex) {
      System.out.println("IOException caught:" + ex.getMessage());
    return object;
//servlet side
public void doPost(HttpServletRequest request, HttpServletResponse response){
      //Extract all the necessary supplied parameters from the request object and configurations.
       String param1 = request.getParameter("param1");
       String param2 = request.getParameter("param2");
  try {
        ObjectOutputStream out = new ObjectOutputStream(response.getOutputStream());
        out.writeObject(object);
        out.close();
      catch (IOException ioe) {
        System.err.println("IOException caught:" + ioe.getMessage());
}

Similar Messages

  • USIM application PIN verification from another applet or MIDlet

    Hi,
    I am writing an applet that among other tasks should authenticate a user by checking PIN. However, I do not want to create (using OwnerPIN API) one more PIN in addition to that used in USIM applet. Is it possible to check if the entered PIN is the correct USIM PIN? Can this check be done from my applet or MIDlet?
    Thank you in advance.
    Aleksandr
    Edited by: sanyas on Mar 9, 2010 4:53 AM

    IE 6.0 will use the <OBJECT> tag.
    Try to remove all of your carriage returns within your text/html file inside the document.writeln (..)
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    alert('place1');
    if (_ie == true) document.writeln(' ...[ no carriage returns in here ].....');
    //--></SCRIPT>

  • Getting notifications from nm-applet

    Hey
    Is there any way to get notifications from nm-applet WITHOUT running a full DE and WITHOUT running a system-tray?
    archboy

    archboy wrote:WITHOUT running a system-tray?
    wiki wrote:In order to run nm-applet without a systray, you can use trayer or stalonetray.
    You also need a notification daemon that listens for notifications and displays them. I use "dunst" for this, it is fairly lightweight.
    Don't forget to enable the notifications in nm-applet, which is done by right clicking on the nm-applet icon. That means you have to run a system-tray at least once to be able to activate the notifications.

  • Opening and closing a frame from an applet security problem

    can I open a frame or a window from an applet and close the frame by using
    System.exit(0) for the frame or will it throw a security problem.

    I am using system.exit(0) to exit the JVM.
    dispose()
    Releases all of the native screen resources used by this Window, its subcomponents, and all of its owned children. That is, the resources for these Components will be destroyed, any memory they consume will be returned to the OS, and they will be marked as undisplayable.
    If this frame have to be close and open again don't use dispose.
    there is no check whether a frame is active? what you can do is set the the new frame to null (frame = null) and also when you dispose it, this will let you know if the frame is active or not.
    Noah

  • Is it possible to pass a string from an applet to the web site?

    Hi, everybody!
    Is it possible to pass a String from an applet to a web site (as a field value in a form, an ASP variable, or anything else). Basically, I have a pretty large String that is being edited by an applet. When a user clicks on the submit button, a different page will show up which has to display the modified string. The String is pretty large so it doesn't fit into the URL variable.
    Please, help!
    Thank you so much!

    Why do you want to do this in Java?
    Javascript is the correct language for these type of situations.
    for instance:
    in the head of your html document:
    <script language=javascript type="text/javascript">
    createWindow(form){
    if(form.text.value!=""){
    newDoc = new document
    newDoc.write(form.text.value)
    newWin = window.open(document,'newWin','width=200;height=150')
    </script>
    in the body:
    <form onSubmit="createWindow(this)">
    <p>
    Enter a String:<input type=text size=30 name="text">
    </p><p>
    <input type=submit value="submit"> 
    <input type=reset value="reset">
    </p>
    </form>

  • Launching Web Start Program from an Applet?

    Hi,
    I need to launch web start program from an applet.
    How can I do that?
    I have tried opening a new web page pointing to the jnlp file from an applet. But, that does not seem to start the web start.
    Thanks in advance
    rg

    I am new to this so may be my questions will appear stupid to a pro, but this is an erro I am getting at compile:
    Can't make static reference to method java.lang.Process exec(java.lang.String) in class java.lang.Runtime.
         Runtime.exec("test.exe");
    What could be the problem?
         ^

  • Print HTML doument without open it from an applet

    I need to know how I can print an HTML document from an applet developed with Jbuilder 4. I'm not a very expert developer and I need a detailed information about this problem. Important is that the HTML document is printed without open it.
    I use: win 2000 pro
    J2RE 1.4.0
    thanks in advance for your help
    Mauro Losa

    Thanks for your help but my problem is that i want print the document without display it.
    I think to have find a solution using Java Print Service API (JDK 1.4) but when i run the example the system display this error refered to this instruction
    "PrintService[] pservices = PrintServiceLookup.lookupPrintServices(flavor, aset);":
    java.lang.UnsatisfiedLinkError: getDefaultPrinterName
    at sun.print.Win32PrintServiceLookup.getDefaultPrinterName(Native Method)
    at sun.print.Win32PrintServiceLookup.getDefaultPrintService(Unknown Source)
    at sun.print.Win32PrintServiceLookup.getPrintServices(Unknown Source)
    at sun.print.Win32PrintServiceLookup.getPrintServices(Unknown Source)
    at javax.print.PrintServiceLookup.getServices(Unknown Source)
    at javax.print.PrintServiceLookup.lookupPrintServices(Unknown Source)
    at untitled4.applet1.main(Applet1.java:32)

  • Opening a frame from an applet

    Hi,
    I want to open a frame in my applet. If I'm using swing, JApplet opening a JFrame, is it possible to keep the frame open if the user browses away from the page that holds the applet?
    Are there any tricks? I've tried opening it in a new Thread, but it still goes away when the the browser's page changes.
    Could I call getParent() from the applet until I get an instance of Frame (which would be the browser) and set my JFrames' parent? Or does that only work with the old Netscape and old AWT Frames?
    I basically want to know if I can keep my JFrame open until the browser is closed. Any ideas or suggestions would be greatly appreciated.
    thank you very much

    Do you want to open a jsp application in a frame when you click on the applet?If so, there is a programme in http://www.globalleafs.com -Java-Java Applets 's download section. Check it out.

  • Opening a browser from an applet

    I got a problem, I want to open a browser from my applet, but I just found one way:
    getAppletContext().showDocument(new URL(
    "http://www.java.sun.com"), "_blank");
    but the problem is: with this, the default browser with defaul settings is opened, and that's what I don't want...
    how can I open the browser with some settings (for example size, or no-url-bar, etc)
    thx for help

    hi,
    try this code:
    public void showDocument(java.net.URL url, String targetWindow)
    when targetWindow can be:
    "_blank" Display the document in a new, nameless window.
    "windowName" Display the document in a window named windowName. This window is created if necessary.
    "_self" Display the document in the window and frame that contain the applet.
    "_parent" Display the document in the applet's window but in the parent frame of the applet's frame. If the applet frame has no parent frame, this acts the same as "_self".
    "_top" Display the document in the applet's window but in the top-level frame. If the applet's frame is the top-level frame, this acts the same as "_self".

  • Closing browser window from an Applet?

    I've written a series of applets that perform different functions. I placed a button on each applet with the purpose to close the window in which that applet is running. However I don't even know where to start looking to find out how to make my applet close it's own browser window. I know how to open a new browser window from an applet but not vice versa.
    Can anyone help please?
    Mark.

    Right, I sort of tracked down some code that uses getMethods to allow me to invoke a Javascript command. It is not pretty and took a little bit of editing to get to work but it does the job without putting JS stuff into my HTML.
    However it is causing some problems. If I open one of my other applets it will only let me close that window and the previous applets ceases to respond at all. I think this may be because the invoke gets the JSObject which is the window and somehow having more than one applet open in different windows is causing it to get confused and is locking the first window and only responding to the second.
    I have seen a much simpler method that uses:
    import netscape.javascript.*;
    and JSObject to get the window but my compiler complains about the import. Any further suggestions or an example would be welcome as my current solution is a bit limited as you can effectively only have one window open at a time which doesn't suit my needs.
    Many thanks.
    Mark.

  • Opening a socket from an applet

    I tried to open a socket from an applet to a server on a remote computer and I've got a refusal message.
    When I try it on a server in the local machine, it works.
    What could be the problem ?
    P.S. : when I open the socket from an application in the Java environment, to the same remote server it works ok.

    this is part of the security system built into java and Applets
    unless you sign an Applet it cannot do many "dangerous" things, like..
    access the loacl file system
    connect to any server except the server that it came from

  • Accessing JavaScript function from an Applet?

    Hi,
    I've found how to access an applet's method from Jscript, but can we do the inverse? I'd like to refresh some frames in my web pages from my applet.
    The refresh of several frames could be done with a Jscript function but how can I call it from my applet?
    Thanks!
    Stephane

    actually look at this link to make more sense
    http://www.woodger.ca/jv_jsint.htm

  • Open a html page from an applet

    Hi,
    I would like to open, from an applet, an HTML page in a new window with a specific width an eight.
    Who can help me ?

    Here is an example of applet to javascript with liveconnect:
    http://www.narhari.com/java/applet2javascript/
    You can use the send(String) method from the sample applet to send something like:
    window.open('xyz.html','myPopup','width=200,height=200');in order to open a window with specific dimensions
    of course you can also build HTML in your applet and use send() + some javascript to render it.

  • [NEWBIE] How to open a frame from an Applet?

    Hi, I'm trying to open a JFrame from an Applet. Basically, I would like that, once the user selects an option from a JMenu, a Frame would be shown with a text box where user could type some content.
    I built both the Applet and the Frame, and singularly they work. When I execute the main method from the JFrame, the window appears, but when I execute something like the following from the applet:
    MyFrame mf = new MyFrame();
    mf.setVisible(true);nothing is shown. I'm sure that I don't know something, but I just started with applets.
    Thanks for any help,
    Marco

    If MyFrame is a subclass of JFrame, then it should not
    make any difference.
    What do you need the JFrame for? Can this be done
    using another "screen" by using a CardLayout?From a menu, when the user selects 'Start game' I need a text box coming out so that the user can insert a word. This word should then evaluate an instance member of the Applet.
    Marco

  • Can you disable the status bar on a web browser from an applet?

    I have a signed applet and am using plugin 1.3.1_02 with IE 5.5. I use the showStatus("text") method to display pertinent information to the user in the browser's status bar.
    Currently I see all types of messages being displayed (in IE's status bar) as my applet communicates with the server. I would like to restrict what is shown in the status bar to show my system messages only.
    Can I filter what is displayed or disable status bar functionality programmatically from the applet? Or possibly with a browser/plugin setting?
    Thanks

    Hi,
    I think you can do that with Java to JavaScript communication.
    thanks,
    Srinivas.

Maybe you are looking for

  • Open item account line with flow type has to contain a partner

    Hi, I am getting the following error while doing periodic posting in flexible real estate management. " Open item account line with flow type Z240 has to contain a partner" " Open item account line with flow type Z820 has to contain a partner" Messag

  • Reports who work in BIP 10G does not work in BIP 11G

    Hi! We are in the middle of going from BIP 10G to BIP 11G (latest patch installed the 9 of february). We have used the Upgrade Assistant to migrate the reports from 10G to 11G, about 80-90% are working directly. But, as always are there some problems

  • Can any one help me with this chat server

    The code below is of a client and server but the problem is that the msg can be sent only from the server and not the client I want that whenever a msg is sent from the server the control for writing the msg should go on to the client n den vise vers

  • OAMessageFileUploadBean eating memory

    I've implemented an upload page using OAMessageFileUploadBean going to a BLOB column in a table. It all works fine except for one thing - when I upload very big files (100s of MB) the memory of the JVM goes up accordingly and eventually runs out. I'm

  • MSS user settings in PPOME

    Hi, I am on MSS 60.1.19 ( ITS version ) . When i log in with MSS user id who is assigned as "Head of ORganization" in PPOME, it should me the subordinate details in Team Viewer iview. If "Head of Own Organizational unit" is not defined no employees a