Can a servlet launch an Applet or Application?

Hello:
Is it possible for a servlet to launch an Applet or Application? I am new to servlet technology, and am trying to find out what I can and cannot do. I've gone through much of the forums, and see that servlet can correspond with Applets, but can servlets launch something other than a servlet? If so, can someone please provide an implementation example?
Thanks in advance for your replies!

Thanks for replying, but I would love for you to be a bit more specific. My knowledge of servlets is limited. I just purchased Marty Hall's moreservlet book, and am just getting done with chapter 3. I would like to write a servlet from which I can launch an applet, but that is not covered in his book (I don't think). I know it can be done because I've seen a code snippet using the applet tag and codebase, but I do not know how to put it together in a complete servlet. Can you please help? I would truly appreciate it!

Similar Messages

  • Hello Mac heads.! I just downloaded Onyx for tiger.  All went well.  But I try to launch onyx from my applications and it doesn't offer checking the S.M.A.R.T. status so I can check my disk.  Everything else appears.  Uninstall only, forums, website etc.

    Hello Mac heads.! I just downloaded Onyx for tiger.  All went well.  But I try to launch onyx from my applications and it doesn't offer checking the S.M.A.R.T. status so I can check my disk.  Everything else appears.  Uninstall only, forums, website etc.

    I think you should get Applejack...
    http://www.macupdate.com/info.php/id/15667/applejack
    After installing, reboot holding down CMD+s, (+s), then when the DOS like prompt shows, type in...
    applejack AUTO
    Then let it do all 6 of it's things.
    At least it'll eliminate some questions if it doesn't fix it.
    The 6 things it does are...
    Correct any Disk problems.
    Repair Permissions.
    Clear out Cache Files.
    Repair/check several plist files.
    Dump the VM files for a fresh start.
    Trash old Log files.
    First reboot will be slower, sometimes 2 or 3 restarts will be required for full benefit... my guess is files relying upon other files relying upon other files! :-)
    Disconnect the USB cable from any Uninterruptible Power Supply so the system doesn't shut down in the middle of the process.

  • How can I avoid running rmiregistry when launch an RMI based application

    Hi,
    How can I avoid running rmiregistry when launch an RMI based application?
    Will invocation of LocalRegistry.createRegistry() do?
    Thanks a lot!
    Regards,
    Justine

    yes it will do...better try it out
    good luck

  • Some files have disappeared from my macbook pro.they were on the desktop and have vanished,i started to do these files again and upon restarting my macbook this morning the new files had gone.Also i can't launch any of my applications safari or app store

    some files have disappeared from my macbook pro they were on the desktop.Iredid some of my work and this morning when i started up my macbook they too had vanished.Spotlight doesn't reveal them and also i can't launch any of my applications like safari app store etc, help please anyone?  thanks

    Restore them from your latest backup

  • Help with passing parameters from a servlet to an applet

    dear all
    i m working on a application which will check weather a file is present in a server (webserver) if it is present then it will take the file name and put it into a drop down list and there is a button on click of which i m taking the call to an applet and then on that i need the file name if it is there then i use it to draw a graph
    i m struck on how to take parameter from Servlet -> Applet
    thanks
    Nakul

    hi,
    I understood your question,The context "servlet" cannot communicate to
    an applet becoz applet runs at clients browswer, rather you can communicate from an applet to servlet(HTTPURLCONNECTION class).
    Well coming to the problem, this is how i have understood your problem,
    basically uou get the list of files from the server using normal servelt programing and you will display in an html LIst box and then click the button to view the graph or chart ,
    then you just want to pass the filename which is there in the listbox to an applet and applet will display some image.
    As we know all that using <PARAM NAME=XX VALUE=YY> WE CAN GET THE VALUE IN APPLET BY USING GETPARAMTER() METHOD. and Im very sure that you are not asking that question. your question is like " both the applets and
    the listboxes will be loaded at once and when he selects one of the file from the list box then without refreshing the page , how to display the graph.
    Im i right?
    If so i guess you have to use javascript to do that stuff, and i think its like gave an id for the tag shown <applet id="yes">
    then in the javascript , you can call the Java applet methods (I have never tried before but seen some demos(i dont have that links- google it for inf))
    but i can give clue like.. trying the <PARAM VALUE=""> IF POSSIBLE
    CHAING THE HTML CONTENT IS POSSIBLE IN IE which is again through javascript by calling yes.innerHTML="<PARAM><PARAM><PARAM><PARAM>..."
    Im sure that you can call Java methods from javascript but i never tried and even you can pass an arguments to it.. Let me check out like
    becoz even im interested to know abt it
    bye
    with Regars
    Lokesh T.C

  • How to call a method in the servlet from an applet

    I want to get the data for the applet from the servlet.
    How to call a method that exits in the servlet from the applet? I want to use http protocol to do this.
    Any suggestions? Please help.
    thanks

    Now that Web Services is around, I'd look at possibly implement a Web Service call in your applet, which can then be given back any object(s) on return. Set up your server side to handle Web Service calls. In this way, you can break the applet out into an application should you want to (with very little work) and it will still function the same

  • A function can not be used in Applet.what's wrong?

    Here is a function.
    private String LoadFile() {
    String input;
    String output="sssssdsdsddf";
    try{
    FileReader f=new FileReader("shu.txt");
    BufferedReader in = new BufferedReader(f);
    while ((input = in.readLine())!= null){output=output+input;}
    in.close();
    }catch(IOException e) {
    System.err.println("Exception caught: " + e.getMessage());
    return output;
    It can be used in Java Application,and work well.but can not be used in Applet,it does not work.what's wrong?

    http://www.javaworld.com/javaworld/jw-12-2000/jw-1215-security.html#sidebar1

  • A function can not be used in Applet.what' wrong?

    Here is a function.
              private String LoadFile() {
    String input;
              String output="sssssdsdsddf";
              try{
              FileReader f=new FileReader("shu.txt");
    BufferedReader in = new BufferedReader(f);
    while ((input = in.readLine())!= null){output=output+input;}
              in.close();
              }catch(IOException e) {   
                   System.err.println("Exception caught: " + e.getMessage());
    return output;
    It can be used in Java Application,and work well.but can not be used in Applet,it does not work.what's wrong?

    Don't you think it would be a bit of a security risk if any applet you downloaded from the web (unknowingly) could read/write to your file system....
    Applets have strict security applied to them, and file i/o is one of the restrictions. There are ways around it, but for the moment I'd suggest you build a bridge and get over it.
    Cheers,
    Radish21

  • Directory structure for servlets and webservices in one application

    hi,
    Can any one help me for creating servlets and webservices in one
    application and deploying in Jboss 4.2.0.
    I want to know exactly what is the directory structure for creating this
    application and what are the additional .xml files for deploying this application.
    if any one know this answere please tell the answere.

    I figured out a solution - it's a problem of policies. In detail: Server1's codebase entry (file:) refers to the class directory of Server1's project. In the simple case of only Client1, which has no codebase entry, it works fine without a file permission on the side of Server1. In the complex case of Client1+Server2, which has to have a codebase entry (file:) refering to the class directory of the Server2's project on a separate machine, for exactly the same method call from Client1 to Server1 a file permission entry on the side of Server1 is needed for Server1's class directory. But WHY ???
    It seems to be a little confusing with the codebase entries, many of the posts are contrary to others and to my personal experiences. Some comments given by Adrian Colley throw a little light upon some aspects. Is there anybody, who can explain the whole topic, when, why, and which part of RMI application deals with codebase entries, also in case of not dynamic code downloading ? May be there is also a reference into the java docs, which I didn't found up to now.
    Thanks in advance
    Axel

  • Why can't I make the applet work?

    I have developed an applet to capture the video stream from a Logitech (usb) camera and display it in the applet. This is a clone of another program that captures a network camera video stream and does the same thing.
    I am using JBuilder 2005 and when I run the applet in the JBuilder applet viewer, it works fine, but not when I attempt to run it in the browser.
    In the network camera application, I was able to overcome this by signing the jar file and it would run in the browser.
    In the Logitech application signing the jar file does not work. I get the mesage that asks me if I want to accept the certificate, but it still does not initialize the camera.
    Since I can use it in the Applet Viewer, I have to assume that all the connections are set up OK.
    But the application fails when trying to get the capture device in:
    di = CaptureDeviceManager.getDevice(str2);
    I put the startup code in a thread and perform several iterations with a slight delay, suspecting that there may be a timing issue, but that was not the problem.
    This code also works in a stand-alone application version.
    The only thing I can think of is that there is some other connection or security issue that I am not addressing.
    Since signing the jar file works with network video streams, I have to think that there is something different between USB and network video streams, but I have no clue as to what it might be.
    Anyone have any suggestions?

    from the JMF readme file
    Security Note
    During the installation, you will be asked two security related questions:
    * Permit recording from an applet
    If you agree to this, JMF will allow applets to capture audio and video from the local capture devices. It is possible for a malicious hidden applet on a web page to quietly record sounds or video from your system and transmit the data back to a system on the internet. This is usually a risk only if you visit unfamiliar web sites.
    You can disable or enable this feature by running the JMFRegistry application (or choose Preferences from the JMStudio File menu), modify the setting in the User Settings tab and commit the changes.
    * Permit writing local files from an applet
    This is a greater security risk since a malicious applet can overwrite files on your hard disk without your knowledge. Enable this feature only if you need it for a specific application and are sure that you will not visit any possibly malicious web sites.
    You can disable or enable this feature by running the JMFRegistry application (or choose Preferences from the JMStudio File menu), modify the setting in the User Settings tab and commit the changes.

  • How to use KM APIs, Can we use them in Standalone J2ee Application

    Hi Experts,
    I got KM APIs.
    I need to use them to access the KM Repository Content.
    I m a newbie in SAP KM.
    Can anyone help me to use KM APIs.
    For Eg:
    com.sapportals.portal.security.usermanagement.IUser user = …
    IResourceContext resourceContext = new ResourceContext(user);
    RID rid = RID.getRID("/etc");
    try {
      IResource resource = ResourceFactory.getInstance()
                           .getResource(rid, resourceContext);
      if( resource != null ) {
        // resource found
        System.out.println("resource " + resource.getRID() + " found");
      } else {
        // resource not found
        System.out.println("resource " + resource.getRID() + " does not exist");
    catch( ResourceException e ) {
      // problem while retrieving the resource
      System.out.println(
                        "exception while trying to get resource " + e.getRID()
                        + ": " + e.getMessage()
    How will i get the IUser populated?
    Can i use KM APIs from a standalone J2EE application?
    Can i Populate IUser in standalone J2EE application's Servlet?
    Please help me out.
    Waiting for reply
    -pankaj

    Hi Prem,
    Can u tell me how to deploy a war file on to the SAP J2EE server?
    I know how to deploy on Tomcat Server, but dont have any experience abt SAP J2EE server.
    Does SAP J2EE server also have some Webapp directory like TOMCAT where we have to put our WAR File?
    Or to Deploy a WAR File in SAP J2EE server is different, if yes then wats the procedure to do that?
    And can i access the KM APIs in SAP J2EE Server?

  • Help needed to call a servlet from an applet

    Hi,
    can someone help me with the way to call a servlet from an applet.
    actually on click of a button i wanna call my servlet and save some data in DB.
    i am not able to call my servlet. see the sample code which i am trying..
    public void actionPerformed(ActionEvent event) {
    if (event.getActionCommand().equals("Upload")) {
    try {
    System.out.println("Upload button has been clicked -----------");
    URL url = new URL("http://localhost:8084/uploadApp/TestServlet");
    URLConnection urlConnection = url.openConnection();
    urlConnection.setDoInput(true);
    urlConnection.setDoOutput(true);
    urlConnection.setUseCaches(false);
    ObjectOutputStream objOut = new ObjectOutputStream (urlConnection.getOutputStream());
    objOut.writeBytes(userId); // pass parameter to servlet
    objOut.flush();
    objOut.close();
    } catch (MalformedURLException ex) {
    Logger.getLogger(ButtonListener.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
    Logger.getLogger(ButtonListener.class.getName()).log(Level.SEVERE, null, ex);
    is there any problem with the code? please suggest.

    hii,
    checkout my add from, HTH
    [http://forums.sun.com/thread.jspa?threadID=5419921&messageID=10885709#10885709]
    ... kopik

  • Can a servlet start it's own threads ?

    Is there any problems with having a servlet start multiple threads to access different databases. In this way the database calls to not have to be synchronous. I'm concerned about starting additional threads from the servlet, while running under iPlanet Application server, since the servlet itself is already threaded and iPlanet will add additional threads as needed.

    Hi,
    You can start multiple threads in a servlet, but the Servlet specification recomends a different approach. Please download the Servlet 2.3 spec from Servlet 2.3 Spec and refer to pages 25 and 26 on how to handle such techniques. Hope this helps.
    Regards
    Ganesh .R
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support

  • Can I Use Jce in applet

    Hi all,
    Thanks for everybody first if you look at my question and try to help me to find out the problem.
    I need to write a applet which can let people to use
    the jce's des function to encipher the user's password and
    id from the homepage.
    I write a applet already. It work fine as a application.
    But it doesn't work when I run it as a applet. Does the problem come from the security problem because I need
    to Load a sun_jce provider in a clien machine ?
    Can I use JCE in applet ?
    If it is ok to use jce in developing applet do I need to sign the applet before run it in web and which file I need to sign.
    Btw, I use the archive tag in html file to make user get the whole jce jar file. does it Ok.
    Followin is my source code
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import java.security.*;
    import sun.misc.*;
    import java.applet.*;
    import java.awt.*;
    public class DesApplet extends Applet{
         public static void main(String[] arg) throws Exception{
              DesApplet des = new DesApplet();
              des.CallDes();
         public void init(){
              CallDes();
         public void paint(Graphics g){
         public CallDes(){
              Cipher desCipher;
              int i;                              
              try{
                   Security.addProvider(new com.sun.crypto.provider.SunJCE());
                   KeyGenerator keygen = KeyGenerator.getInstance("DES");
                   SecretKey desKey = new SecretKeySpec("11111111".getBytes(),"DES");
                   System.out.println("Hello");
                   desCipher = Cipher.getInstance("DES/ECB/NoPadding");
                   desCipher.init(Cipher.ENCRYPT_MODE,desKey);
                   byte[] cleartext = "00000000".getBytes();
                   String value = convert_int_to_hex(cleartext,8);
                   System.out.println("cleartext is:"+value);
                   byte[] ciphertext = desCipher.doFinal(cleartext);
                   value = convert_int_to_hex(ciphertext,8);
                   System.out.println("ciphertext is:"+value);
                   desCipher.init(Cipher.DECRYPT_MODE,desKey);
                   byte[] cleartext1 = desCipher.doFinal(ciphertext);;
                   value = convert_int_to_hex(cleartext1,8);
                   System.out.println("cleartext1 is:"+value);
              }catch(Exception e){System.err.println(e);}
         public String convert_int_to_hex(byte[] value, int len) {
         int i;
         int j;
         byte tmp;
         byte[] temp = new byte[len*2];
         char[] chars = new char[len*2];
         String result = new String();
         for (i=0; i<len; i++)
         if (value[i] < 0)
         temp[i*2] = (byte)((value[i] & 0xF0) >>> 4);
         temp[i*2+1] = (byte)(value[i] & 0x0F);
         else
         temp[i*2] = (byte)(value[i] / 16);
         temp[i*2+1] = (byte)(value[i] % 16);
         for (i=0; i<len*2; i++)
         if (temp[i] > 9)
         chars[i] = (char)(temp[i] - 10 + 65);
         else
         chars[i] = (char)(temp[i] + 48);
         result = result.concat(result.valueOf(chars));
         return result;

    I have a server and a client.
    Server has jdk1.4. client is an applet. I need to encrypt the username and password that are sent from client to the server.
    I am able to encrypt and decrypt using JCE's DES on server side, since jdk1.4 has JCE provider installed by default. Since the applet may be running on any browser which may not have JCE supported. Is it possible for me to send the JCE jar file along with the applet and somehow enable the client applet to encrypt the user name and password and send to server.
    Thanks a lot,
    Gagan.

  • Why do we use both servlets & jsps in developing  an application ?

    why do we use both servlets & jsps in developing an application & not only jsps

    Hi,
    It's a pure question of design : Some like it jsp to jsp and others servlet to jsp. It's up to you to decide and it depends of the complexity of your application.
    But the best design is the MVC (servlet and jsp working together) because it helps you separate presentation from logic. It also helps you better maintain you code.
    You can have more info in javaworld.com.
    Good luck
    touco

Maybe you are looking for

  • BSP and Webdynpro real time questions

    Hello gurus, Can any one help me in proviiding me with the real time scenarios in BSP's and Webdynpro for ABAP. i have just been trained on them but not really worked. If you all can also provide me with the interview questiosn it will be very helpfu

  • PO Response - how to inform purchasers about differencies?

    Hello all! We are using SRM 5.0 on Server 5.5 and ECC 6.0 - plan driven procurement. It's possible to create purchase order responses and they arrive in ECC, but how can I inform the purchasers about differences? Kind regards, Barbara

  • Idoc Segment adding

    hi,    i have extended a idoc with few segements and i am trying to add a few segements to the idoc in the BADI how to specify the hirarchy. cheers

  • MRP run for consumables

    HI, What is the tcode we have to use to run mrp for consumables. Consumables are not maintained in bill of material but we are using manual reorder point planning vb and entered the reorder point.Whether we have to enter the requirement for each cons

  • ERPi database not updating from 11.1.2.1 to 11.1.2.2

    I am in the process of updating from ERPI 11.1.2.1 to 11.1.2.2. I have moved the ERPI Oracle schema to a new DB and ERPI 11.1.2.2 is on a new server, in a new environment. When running the config tool to do the "configure database" task, I tried choo