Replace HTML page with an applet

Hello to everybody!
I created a servlet who can manage file upload from an HTML page.
Now I want to replace that HTML page with an applet.
I know that I need to use multipart/form-data , but I have no experience with applet.
HTML page code is:
<html>
<head><title>Upload</title></head>
<body>
<FORM ACTION="http://localhost:8080/examples/servlets/servlet/UploadTest" ENCTYPE="multipart/form-data" METHOD=POST>
What is your name? <INPUT TYPE=TEXT NAME=submitter> <BR>
Which file do you want to upload? <INPUT TYPE=FILE NAME=file> <BR>
<INPUT TYPE=SUBMIT>
</FORM>
</body>
</html>
Any help for "translating" this html page into an applet?
Applet will send, like html page, a string and a file.
Thanks in advance, Liuk

If you use something like Apache Http Client you dont have to do any low level implementations.
Also if you are the one who is writing both servlet and applet you dot have to stick to standerd formats. you can develop your own format and write both servlet and applet to handle it. that kind of thing can be done easily even with URLConnection. But if you plan to send large files then URLConnection may not be the right option becouse I have seen many complaining that URLConnection gives OutOfMemoryErrors when uploading large amounts of data.

Similar Messages

  • Which is better - 1 HTML page with multiple applet panels or 1 applet with

    Hi friends,
    This is a critical doubt which decides the future of my project.
    I have implemented a graph in which an html shows 3 panels on the screen via calling that applet 3 times.
    Would it be good if we call that applet only once and modify the applet to show 3 panels?
    Thanks in advance

    hai paskal,
    well having 3 panels in a single applet will not make a big difference when compared to having 3 diff applets with 1 panel each ...
    what matters most is how u want to have ur web page ...
    if you have 3 different applets then you can place them in a position according to ur wish ...
    if it is one then all of them will be together ...
    Peter

  • Displaying html page with in the applet

    I want to open an html page in the applet. If i use showDocument() of applet, it opens the html page in the browser, but i want to open the html page with in the applet(i.e., applet should display the html page). Is there any way which i can do the above thing.
    Thanks in advance

    Look at this sample:
    import java.awt.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.text.*;
    public class BrwsA extends JApplet
         JPanel      jpa = new JPanel();
         JEditorPane jed = new JEditorPane();
         JScrollPane jsp = new JScrollPane(jpa);
    public BrwsA()
         jpa.setLayout(new BorderLayout());
         jpa.add(jed);
         jpa.setPreferredSize(new Dimension(800,1000));
         jed.setEditable(false);
         jed.setContentType("text/html");
         jed.getEditorKit().createDefaultDocument();
         setContentPane(jsp);
    public void init()
         try
              URL url = new URL(getCodeBase(),"test.html");
              jed.setPage(url);
         catch(MalformedURLException e)
         catch(IOException e)
    }Noah

  • Opening html page with in the applet

    I want to open an html page in the applet. If i use showDocument() of applet, it opens the html page in the browser, but i want to open the html page with in the applet(i.e., applet should display the html page). Is there any way which i can do the above thing.
    Thanks in advance

    Use a JEditorPane to display HTML (supports version 3.2 though)
    check API (that's for JDK 1.4.1 so check for version you use)
    http://java.sun.com/j2se/1.4.1/docs/api/javax/swing/JEditorPane.html
    Sky

  • Applet blinks  when  launched  in a html page with black background

    Dear sirs:
    I 'm testing a game applet and preparing for deployment. However, whenever i reload the html page containg the applet, the applet will first appear as a white block and then switch to black-background( i set black as bg in first sentence at applet's init() ) .
    It's really annoying as the bgcolor of html is black. I try to set the applet and div's visibility be hidden, but the problems remains. And i try to add a black div covering on the applet( with z-index = 200) , it still blinks.
    Does anyone know how to startup the applet with background other than white?
    I use windows, and jre1.6.0.1 plugin.
    i Searched in google with no result.
    Thanks a lot.

    an initial fade in/out is added after init() function to reduce the flicking.
    some javascript tricks are used to reduce the white flashing after reloading. now it's much better and acceptable.
    However, i still want to know does anyone have some better tricks?
    There's a bug report in 2002 which is shown as "fixed", "closed". i think it's the same problem( in fact not fixed).
    The applet does not start up with the background color set in init() function. It first appears as a white block for 0.2-0.3 second, then switches to the user defined bgcolor . really annoying.

  • Designing Embedded HTML Page with iWeb

    I designed a html page with with an embedded html page within it. It all looks fine in iWeb, but when I upload the page to the intenet and I try to view this page it does not come up properly. Although I initially see the page come up as I designed it (for a fraction of a second) it then disapears and I only see the page I embedded on my page.
    I added the following codes in HTML Snippet:
    <object data=http://www.mls.ca/PropertyResults.aspx?&vs=Residential&ret=300&curPage=PropertySearch.a spx&sts=0-0&beds=0-0&baths=0-0&bt=1%2c16%2c17&atsg=%2c&ci=cartierville&pro=4&mp= 500000-0-0&mrt=0-0-4&trt=2&of=1&ps=10&o=D width="600" height="400"> <embed src=http://www.mls.ca/PropertyResults.aspx?&vs=Residential&ret=300&curPage=PropertySearch.a spx&sts=0-0&beds=0-0&baths=0-0&bt=1%2c16%2c17&atsg=%2c&ci=cartierville&pro=4&mp= 500000-0-0&mrt=0-0-4&trt=2&of=1&ps=10&o=D width="600" height="400"> </embed> Embedd a web page within another web page. </object>
    <object data=http://www.mls.ca width="600" height="400"> <embed src=http://www.mls.ca width="600" height="400"> </embed> Embedd a web page within another web page. </object>
    As I said, the above pages come up fine in iWeb but not when I search them with Sagari.
    Can someone please help with this. Thanks, Padano

    This is the proper code :
    <iframe src="http://url.to.file.html" frameborder="0" width="500" height="500" scrolling="no" allowTransparency="true"></iframe>
    You can also use this :
    <div style="width: 650px; height: 650px">
      <script language="JavaScript">
        location.replace('../../../your files.html');
      </script>
    </div>
    Source : iframe alternative in the HTML Snippet
    And on this page you can see how to use <object> for html, png and jpg files :
    Embed content with the <object> HTML element

  • A tree-view in HTML page with nodes generated with java script in run time is not visible in the UI Automation Tree. Need Help

    I have a HTML page with an IFrame. Inside the Iframe there is a table with a tree view
    <iframe>
    <table>
    <tr>
    <td>
    <treeview id="tv1"></treeview>
    </td>
    </tr>
    </table>
    </iframe>
    In UIA, i am able to traverse till the tree view but not able to see it.
    I have used the TreeWalker.RawViewWalker Field to traverse the node from the desktop Automation.RootElement. 
    I tried to use AutomationElement.FromPoint method to check whether i am able to get that element. Fortunately i was able to get the automation element. 
    i tried to get the path to root element from the node element using the TreeWalker.RawViewWalker. I was able to get the parent path to the root element.
    But trying the reverse way like navigating from root element to tree node, was not getting the element for me. 
    Please help me with suggestions or inputs to resolve this issue. 

    Thanks Bernard,
    It works fine with JInitiator but not working with
    the JPI. For JPI what settings I need to do ??hi TKARIM and Bernard, i am having similar problem even with the Bernard's recommended setup. could you post the webutiljini.htm (i presume you are using config=test) ?
    i am actually using jinitiator 1.3.1.28 with Oracle HTTP Server of OAS 10gR2) calling Forms Server 6i (f60cgi). After setting up according to Bernard's recommended setup steps, the java console showed that it loaded the icon jar file when it could not read the form, but it skipped the loading of the icon jar file once it read and started the form. How do we specify in the form to pick up the icon from the jar file instead from a directory ? Or do we need to specify ? Any ideas ?
    Thx and Regards
    dkklau

  • How to call html page with in the flash

    I am new to action script, can some one guide me how to call html page with in the flash. lets say i have movie clip having instance name as "news_feed", I need to disply the html page in this news_feed. kindly help me, thanks alot

    some one tell me, weather it is possible or not ??

  • Printing HTML PAGE in a Applet

    I am tryng to print a HTML Page in a Applet .
    When Using Eclipse Environment everythig goes fine.
    Now I am trying to use the appletviewer to run the same
    source, but it appears the following:
    http://10.15.1.26/
    Conecting to http://10.15.1.26/
    Exception in thread "AWT-EventQueue-2" java.lang.RuntimeException: java.security.AccessControlException: access denied (java.net.SocketPermission 10.15.1.26:80 connect,resolve)
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(Unknown Source)
         at java.net.HttpURLConnection.getResponseCode(Unknown Source)
         at javax.swing.JEditorPane.getStream(Unknown Source)
         at javax.swing.JEditorPane.setPage(Unknown Source)
         at javax.swing.JEditorPane.setPage(Unknown Source)
         at javax.swing.JEditorPane.<init>(Unknown Source)
         at AppletPrintHTML$EditorPaneHTMLViewer.loadStartingPage(AppletPrintHTML.java:90)
         at AppletPrintHTML$EditorPaneHTMLViewer.<init>(AppletPrintHTML.java:103)
         at AppletPrintHTML$5.actionPerformed(AppletPrintHTML.java:364)
         at java.awt.Button.processActionEvent(Unknown Source)
         at java.awt.Button.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.security.AccessControlException: access denied (java.net.SocketPermission 10.15.1.26:80 connect,resolve)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkConnect(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.http.HttpClient.<init>(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    Why I am not allowed to connect to the site without Eclipse? Any Idea?
    Angel Portal

    This code
              * Load a HTML Page
              private void loadStartingPage() {
              try {
                   System.out.println("Conectando a "+ path);
                   mainPane = new JEditorPane(path);
                   } catch (IOException e) {
                        System.err.println("N�o Pode Conectar");
                        System.exit(1);
    Open a html page ( path ) on JEditorPane!
    In Eclipse worked just fine!
    But if I try to do that on a Browser or appletviewer the error a told you shows up.
    I am reading about the The Permission Classes.Someone have heard of it?

  • Building HTML page with JSP from different applications

              Hi,
              we need to build a HTML page with 2 JSPs. If both JSP were in the same Application
              (Weblogic 8,1) there is no problem. But I have to use JSPs from differents web
              applications, each JSP is in different war files.
              How can I compose this page? How can I management the request object?
              thanks
              

    Your program print the whole jsp source code??
    This is your web server configuration problem.
    Your web server handle your jsp page like text file only.

  • Rewrite a complete HTML page with all result inside with JSP

    i have generate a HTML page with JSP. Then by an action on a menu on the left frame,i have to rewrite this page with the data already seized, and more code inside(i.e complete the page).
    How can i do ?

    Use JavaScript to tell the other frame to reload or to go to another location. Generate the JavaScript if you're processing a request of the menu...

  • How to upload a HTML page with Flash image viewer?

    I´ve got a html page with a flash image viewer file inn it. Preview in a browser is ok, but I don´t get it right on the server. Is it something spesial with the swf file?
    This is what i have done: I just upload html -page, viewer swf file and the pictures to the same folder. Is this wrong?
    Sorry, I really don´t have a clue... Thanks!

    Sorry to say, but that is not a webpage -
    There is no doctype, no head section, no body section .
    etc. etc.
    Nothing would work in that document.
    Please generate a properly formed HTML page, and place the scripts and script calls in the proper section and the rest in the body, and let's see what you get

  • To add meta tags, you open your published .html pages with TextEdit or any other text editor and modify as required. You have to do redo it each time you republish. Ihow do I do this? I need step by step instructions

    To add meta tags, you open your published .html pages with TextEdit or any other text editor and modify as required. You have to do redo it each time you republish. I need step by step instructions on how to accomplish this  please .

    Rage Sitemap Automator and iWeb SEO Tool are two different applications.
    Use SEO Tool to add the title tag and meta description. These need to be added to the html file for every page of your website. SEO Tool stores all these so that when you republish you only need to add tags to any new pages and click the re-apply button to refresh the existing ones.
    Once you have added. refreshe the tags with iWeb SEO Tool and uploaded the files with your FTP application, then open the site in Sitemap Automator and create and upload a new sitemap.
    Once you have set up accounts with Google, Yahoo and Bing, verified your site with each and submitted a sitemap, on subsequent publishing Sitemap Automator will resubmit the sitemap with one button click. It will also notify Ask.com whch doesn't require an account since you can add your domain name to this URL to ping them...
    http://submissions.ask.com/ping?sitemap=http%3A//www.domain.com/sitemap.xml

  • HTML Page with Applet in JEditorPane

    Hi,
    I have a JEditorPane in which i want to show a HTML page which has an Applet embedded in it. Is there anyway that I can do this as if I just give the URL of the HTML file it gives me a text field with applet tag written in it.
    Or is there any other way that I can embed an Applet in my application in one of Swing components.
    Thanks in advance,

    Update:
    You may want to extend HTMLEditorKit:
    public class MyHTMLEditorKit extends HTMLEditorKit() {
        static ViewFactory viewFac = new HTMLFactory(){
           public View create(Element el) {
              if(el.getName().equalsIgnoreCase("APPLET")) {
                  Applet app = ...; // create applet from other attributes
              else return super.create(el);
    }Check this out. I don't know whether applet elements are included in the parsed document; nevertheless, check it out.
    Fritz

  • 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.

Maybe you are looking for

  • RMAN script- delete archives.

    Is this a solid rman backup script? I am getting varied times for a daily backup- some days it's a normal 1 hour, next day it's 6 hours. I can't find a reason- no errors are being generated, I am told to find out why this server does this and not our

  • How can I get info off iPhone back onto my Mac

    My computer had a heart transplant (hard drive replaced - lost everything . I now need to get my info (contacts, photos, tunes, calendar, etc.) off my iPhone (original generation) back on my hard drive. Can someone help me do this please? I was smart

  • Java Proxy error .... com.sap.aii.utilxi.misc.api.BaseException

    Hello All, I have generated a java proxy and trying to compile in Developer Studio. I am getting this error while doing so. I have all my jars in classpath. com.sap.aii.utilxi.misc.api.BaseException Below are the jars i have in my class path.. Anybos

  • FMS require SO ship to address on production order

    Hi Experts, I need one formatted search at production udf header level to capture SO ship to address. Thanks & Regards- Mona

  • [SOLVED] texlive errors

    While trying to 'make' a texlive documents I get the following error: Package hyperref Message: Driver: hpdftex. (/usr/share/texmf-dist/tex/latex/hyperref/hpdftex.def (/usr/share/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty)) ! LaTeX Error: File