I want to display a HTML file that is stored locally on my machine.

Hello,
I am having a problem with my paths (I believe). I have created a JEditorPane that reads in a HTLM page. If the page is form the web it works fine:
page_jep.setPage("http://www.google.com");However I want to display a HTML file that is stored locally on my machine.
I have tried the following but cant get it to find the stored page:
page_jep.setPage("file:///index.htm");
java.io.FileNotFoundException: \index.htm (The system cannot find the file specified)I have tried putting the index file in both the root directory ( C ) and also the same place as where the class files are.
Any help will be gratefully received,
Harold Clements

Nope, I have tried it:
page_jep.setPage("file://c:\\index.htm");Gives me:
java.net.UnknownHostException: c

Similar Messages

  • How to display the HTML File Titles instead of File Names

    Hello All,
    I want to display the HTML file titles instead of File names in the Search Results. I've tried to give this command in the 'Visible Properties' in the 'SearchResourceRenderer' as:-
    Visible Properties: rnd:displayTitle
    However this is not working for me. If anyone has an idea of what to pass here or any other alternative to display the Titles.
    Regards
    Vaib

    Summary of steps:
    1) Standard Layout Set used: SearchResultLayoutSet
    2) Create a new layout set using ADVANCED COPY
    3) Change properties as you require
    4) Next modify the search OTH file to reflect this newly created Layout Set (under KM > root > etc > oth > search.oth edit xml file property rndLaoutSet from SearchResultLayoutSet to MyCustomSearchResultLayoutSet)
    5) Check in the document to complete the editing process if Edit Locally is used!
    6) Lastly, activate the OTH file by –
    •     Setting Debugging settings via Debugging Settings
    •     Performing a normal search
    •     Clicking Rendering information and then following link OTH Overview click on Reload
    7) Reload above reloads the OTH file and performing search again will yield the desired result
    8) To turn off the Rendering Information link remove the user id from Debugging Settings.
    Cheers
    Ankit

  • Display of HTML file titles instead of File Names

    Hello All,
    I want to display the HTML file titles instead of File names in the Search Results. I've tried to give this command in the 'Visible Properties' in the 'SearchResourceRenderer' as:-
    Visible Properties: rnd:displayTitle
    However this is not working for me. If anyone has an idea of what to pass here or any other alternative to display the Titles.
    Regards
    Vaib

    Summary of steps:
    1) Standard Layout Set used: SearchResultLayoutSet
    2) Create a new layout set using ADVANCED COPY
    3) Change properties as you require
    4) Next modify the search OTH file to reflect this newly created Layout Set (under KM > root > etc > oth > search.oth edit xml file property rndLaoutSet from SearchResultLayoutSet to MyCustomSearchResultLayoutSet)
    5) Check in the document to complete the editing process if Edit Locally is used!
    6) Lastly, activate the OTH file by –
    •     Setting Debugging settings via Debugging Settings
    •     Performing a normal search
    •     Clicking Rendering information and then following link OTH Overview click on Reload
    7) Reload above reloads the OTH file and performing search again will yield the desired result
    8) To turn off the Rendering Information link remove the user id from Debugging Settings.
    Cheers
    Ankit

  • Want to open a new browser window and display the html file in locale disk.

    Hi,
    I want to open a new browser window and display the html file in local drive. The below html applet work in local system successfully. But i deploy the same in web server (Tomcat) and try the same in client machine it does not work. Please help.
    Note:
    The class below fileopen.FileOpen.class i make it as a jar and put it in jre\ext folder at the client machine.
    ------------------------------------FileOpen.html(Tomcat)-----------------------------------------------------
    <html>
    <body >
    <applet code="OpenFile.class" archive="loadfile.jar" width="100" height="100">
    <param name="path" value="file://c:/open.html" />
    </applet>
    </body>
    </html>
    -------------OpenFile.java in server(Tomcat)--------------------------------------------
    public class OpenFile extends Applet implements ActionListener{
    String path = "";
    fileopen.FileOpen open = null;
    Button b = null;
    public void init(){
    path = getParameter("path");
    b = new Button("Open");
    b.addActionListener(this);
    add(b);
    public void actionPerformed(ActionEvent ae){
    try
    open = new fileopen.FileOpen(this,path);
    catch (Exception e){
    e.printStackTrace();
    -------------------------------------------FileOpen.java /Client JRE/ext----------------------------------------------------
    package fileopen;
    public class FileOpen
    AppletContext context = null;
    URL url = null;
    public FileOpen(Applet applet,String path)
    try
    if(null != applet){
    context = applet.getAppletContext();
    if (null != path)
    url = new URL(path);
    context.showDocument(url, "_blank");
    }catch(Exception ex)
    ex.printStackTrace();
    Please help to solve this issue very urgent.
    Thanks in advance.
    By,
    Saravanan.K.

    zzsara wrote:
    I want to open a new browser window and display the html file in local drive. ...Did you ever pause to consider how ridiculous that is?
    The best audience for applets is people off the internet. 'People off the internet' might be using a computer that has no (what was it?) 'open.html' in the root of the C: drive. In fact (shock horror) they may not even be running Windows, and would therefore probably have no 'C:' drive at all.
    If you do not intend to distribute this to people off the web, an application makes a lot more sense, but even then, you cannot rely on the document being there unless you 'put it there' (during installation, for instance).
    As the other poster intimated, applets can load documents off the local disk as long as they are trusted. Here is an example*, but note that it is not so rash as to presume any particular path or file, and instead leaves it to the user to choose the document to display.
    * The short code can be seen at SDNShare on the [Defensive Loading of Trusted Applets|http://sdnshare.sun.com/view.jsp?id=2315] post.
    On the other hand, a sandboxed applet can load any document coming from its own server via URL, or get showDocument(URL) to work. In that case, the JRE must recognize that the URL is from its own server, so the best way to form URLs for applet use is via the URL constructor
    new URL(getDocumentBase(), "path/to/open.html");That is how I form the URL in this [ sandboxed example of formatting source|http://pscode.org/fmt/sbx.html?url=/jh%2FHelpSetter.java&col=2&fnt=2&tab=2&ln=0]. Of course, in this case the applet loads the document, then parses the text to draw the formatted version, but the point is that an URL produced this way will work with showDocument(URL).
    I am pretty sure showDocument() in an applet off the internet will work with an URL pointing to a foreign (not its own) server, but it will not be able to load documents off the end user's local disks.
    I suggest a couple of things.
    - Try to express this problem in terms of what feature it is that you want to offer the end user. Your question jumps directly to a bad strategy for achieving ..who knows what? An example of a feature is "Shows the applet 'help' files on pressing F1".
    - A good way to indicate interest in a solution is to offer [Duke stars|http://wikis.sun.com/display/SunForums/Duke+Stars+Program+Overview] to match that interest.
    Edit 1:
    ..and please figure out how to use the CODE tags.
    Edited by: AndrewThompson64 on Sep 12, 2008 11:14 PM

  • Create HTML file that can display unicode (japanese) characters

    Hi,
    Product:           Java Web Application
    Operating system:     Windows NT/2000 server, Linux, FreeBSD
    Web Server:          IIS, Apache etc
    Application server:     Tomcat 3.2.4, JRun, WebLogic etc
    Database server:     MySQL 3.23.49, MS-SQL, Oracle etc
    Java Architecture:     JSP (presentation) + Java Bean (Business logic)
    Language:          English, Japanese, chinese, italian, arabic etc
    Through our java application we need to create HTML files that have to display unicode text. Our present works well with English and most of the european character set. But when we tried to create HTML files that will display unidoce text, say japanese, only ???? is getting displayed. Following is the code we have used. The out on the browser displays the japanese characters correctly. But the created file displays only ??? in place of japanese chars. Can anybody tell how can we do it?
    <%
    String s = request.getParameter( "txt1" );
    out.println("Orignial Text " + s);
    //for html output
    String f_str_content="";
    f_str_content = f_str_content +"<HTML><HEAD>";
    f_str_content = f_str_content +"<META content=\"text/html; charset=utf-8\" http-equiv=Content-Type></HEAD>";
    f_str_content = f_str_content +"<BODY> ";
    f_str_content = f_str_content +s;
    f_str_content = f_str_content +"</BODY></HTML>";
    f_str_content = new String(f_str_content.getBytes("8859_9"),"Shift_JIS");
    out.println("file = " + f_str_content);
              byte f_arr_c_buffer1[] = new byte[f_str_content.length()];
    f_str_content.getBytes(0,f_str_content.length(),f_arr_c_buffer1,0);
              f_arr_c_buffer1 = f_str_content.getBytes();
    FileOutputStream l_obj_fout; //file object
    //file object for html file
    File l_obj_f5 = new File("jap127.html");
    if(l_obj_f5.exists()) //for dir check
    l_obj_f5.delete();
    l_obj_f5.createNewFile();
    l_obj_fout = new FileOutputStream(l_obj_f5); //file output stream for writing
    for(int i = 0;i<f_arr_c_buffer1.length;i++ ) //for writing
    l_obj_fout.write(f_arr_c_buffer1);
    l_obj_fout.close();
    %>
    thanx.

    Try changing the charset attribute within the META tag from 'utf-8' to 'SHIFT_JIS' or 'utf-16'. One of those two ought to do the trick for you.
    Hope that helps,
    Martin Hughes

  • BSP to display an HTML file in local drive

    Hi,
       I am developing a BSP application, where after accepting the some parameters from users in the initial screen, I have to open a document in KPRO based on the values entered by the user and take the HTML file attachmet from KPRO document and store it in Local drive then display that HTML file in the BSP screen. Is it possible to do?If yes, how to do this. It is not compulsory to store the HTML locally, I have to display the html page in BSP.
       This BSP will be called from Enterprise Portal.
    Regards,
    Sathish

    sathish,
    so you want to display a html page in BSP. If i understood your requirement correctly,
    you will be having the path of the file so just use the below code to display it in the bsp.
    <a href=" http://w3.hr.xxxxxxxxxxxxcom/people/asp/globalCompetencies.asp"
      target="_blank" STYLE="color:blue;font-size:11; font-face:arial;"
      OnClick="window.open(this.href,'_blank',
                    'width=500,height=500,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1');
                return false;"
      ><%=otr(YP_HRPA/GLOBAL_COM)%></a><
    regards,
    manasa

  • How to display a html file without tags?

    Hello,
    I am new for Java programming. Now i have to display a html file without all the tags. My code is the fllowing:
    u = new URL("http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?db=protein&val=55584070");
    BufferedReader in = new BufferedReader(new InputStreamReader(u.openStream()));
    while ((s = in.readLine()) != null) {
    System.out.println(s);
    in.close();
    Unforturnately, the output is the soucecode of the html file and I just want the content.
    Please help me.
    Thanks a lot in advance,
    Danica

    Here's a simple example
    http://forum.java.sun.com/thread.jspa?threadID=293830
    I haven't tested it, but I bet camickr did.

  • To display an html page that contains frames, using servelt

    Hi all
    i am using a servlet which has to display a html page that contains frames.
    I would like to know whether it is possible to display a frame using servlets.
    If yes please tell me the how to do it?
    Thanks,
    Sudheer.

    Thanks Seth.
    I just tried that, but when I run it in preview mode (by simply hitting F12), it gives me an error because it can't  find the file in the temporary preview folder it creates (ie:
    C:\Users\Tom\AppData\Local\Temp\CP2840464090993Session\CPTrustFolder2840464091009\Captivat ePreviewLoader\
    I'm hoping to find a place to put it so that it works when running F12 and when running in regular 'published' mode
    I was thinking I could put it in the 'C:\Program Files\Adobe\Adobe Captivate 6 (32 Bit)\Templates\Publish' folder, but when I do that, it doesn't seem to gete copied to the .\CaptivatePreviewLoader folder when running F12

  • I want to display a video file on Flash without ENCODING IT! HELP ME PLEASE

    Hi everyone! I am using Macromedia Flash 8 and now I want to
    display a video file (avi formatted, for example) on flash . But
    the main idea is that I don't want to encode this file into *.flv
    file, I want to display it directly. Please, any one , can you help
    me to find a solution?!
    thanks very much

    Nope, I have tried it:
    page_jep.setPage("file://c:\\index.htm");Gives me:
    java.net.UnknownHostException: c

  • Why does DW CC 2014.1 Fluid Grid load HTML file that contains Google Analytics Tracking Code script so slowly?

    I exclusively work in Fluid Grid since my site is a Responsive Web Design.  I'm having trouble with slow load time in DW CC 2014.1, when my file, as they all do of course, has the Google Analytics Tracking Code script.
    I'm on a Windows 8.1 using a Dell Precision M3800 Laptop with Memory 16GB (2x8GB) 1600MHz DDR3 . Each of our site's 180 or so web pages, of course, has its Google Analytics Tracking Code script. It is placed, following Google instructions, as the last entry in the <head>.  Google Analytics does not instruct to place the script in the JS Folder with an scr to it, but rather in the <head>.  It takes up to one and a half or two minutes for DW CC 2014.1 to load the Google Analytics Tracking Code script .  That is, the grid does not show in Live View until finally analytics.js shows up in the Document Toolbar. A minute or two can add up when every page you load takes this long.  And, making new Fluid Grid pages, as is done, through the Save As command; every new page made you have to deal with the minute or two wait time since all those pages have the Google Analytics Tracking Code script.  Therefore, this time component alone, assuming I'm accessing and/or making 20 pages per week (and in our business this is easily the case) the math is that I'm wasting between 17 and 35 hours per year just with DW CC 2014.1 loading the much needed Google Analytics Tracking Code script.
    I have loaded HTML files that do not have the Google Analytics Tracking Code script as a test and those files load at the normal quick speed.
    Therefore, the new Chromium Embedded Framework browser engine has a serious load problem when it confronts an HTML5 file with a Google Analytics Tracking Code script.  Oddly, the prior DW CC 2014 version, with the old browser engine did not have this slow-load problem since I was loading these same files in that DW CC version up until October 8th or so.
    I think this new browser engine is a Google platform that apparently has a problem rendering or loading a Google Analytics Tracking Code script.  That makes no sense.
    Anyone else had this particular slow-load problem with DW CC 2014.1?
    Thanks.

    Wow.  That sure solved the slow-load problem, at least using your suggested snippet in a simple test HTML file.
    Per Google's instructions, I pasted the snippet before the closing </head> tag.  And, even in that positioning in the file; the file loaded at the speed (about one second) that it did prior to DW 2014.1.
    Two questions.
    Will this snippet provide the same tracking data as my current GA snippet?
    Because my current GA snippet is in about 200 web pages, can I retain the old snippet in most of them and place the new snippet in my approximately 5 main web pages as well as my templates so my new pages, as well as my main pages, have the new snippet.  That is, can I have both snippets (i.e. old snippet in earlier pages and new snippet in main pages and new pages to be made going forward) in my website at the same time?
    Of course I would not have both the old and new snippet in a web page at the same time.
    I greatly appreciate any assistance anyone can provide me on this issue and thank all of you in advance.
    I've provided code for both simple test files below.
    Code for Asynchronous Syntax of GA script:
    <!doctype html>
    <!--[if lt IE 7]> <html class="ie6 oldie"> <![endif]-->
    <!--[if IE 7]>    <html class="ie7 oldie"> <![endif]-->
    <!--[if IE 8]>    <html class="ie8 oldie"> <![endif]-->
    <!--[if gt IE 8]><!-->
    <html class="">
    <!--<![endif]-->
    <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Test Asynchronous GA Tracking Code In Head</title>
    <link href="css/boilerplate.css" rel="stylesheet" type="text/css">
    <link href="/css/style.css" rel="stylesheet" type="text/css">
    <!--
    To learn more about the conditional comments around the html tags at the top of the file:
    paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
    Do the following if you're using your customized build of modernizr (http://www.modernizr.com/):
    * insert the link to your js here
    * remove the link below to the html5shiv
    * add the "no-js" class to the html tags at the top
    * you can also remove the link to respond.min.js if you included the MQ Polyfill in your modernizr build
    -->
    <!--[if lt IE 9]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <script src="js/respond.min.js"></script>
    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-73425000-1']);
      _gaq.push(['_trackPageview']);
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    </script>
    </head>
    <body>
    <div class="gridContainer clearfix">
      <div id="div1" class="fluid">
        <div id="test1" class="fluid ">This is the content for Layout Div Tag "test1"</div>
       <div id="test2" class="fluid ">This is the content for Layout Div Tag "test2"</div> 
    </div>
    </body>
    </html>
    Code for older GA script snippet:
    <!doctype html>
    <!--[if lt IE 7]> <html class="ie6 oldie"> <![endif]-->
    <!--[if IE 7]>    <html class="ie7 oldie"> <![endif]-->
    <!--[if IE 8]>    <html class="ie8 oldie"> <![endif]-->
    <!--[if gt IE 8]><!-->
    <html class="">
    <!--<![endif]-->
    <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Test GA Tracking Code In Head</title>
    <link href="css/boilerplate.css" rel="stylesheet" type="text/css">
    <link href="/css/style.css" rel="stylesheet" type="text/css">
    <!--
    To learn more about the conditional comments around the html tags at the top of the file:
    paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
    Do the following if you're using your customized build of modernizr (http://www.modernizr.com/):
    * insert the link to your js here
    * remove the link below to the html5shiv
    * add the "no-js" class to the html tags at the top
    * you can also remove the link to respond.min.js if you included the MQ Polyfill in your modernizr build
    -->
    <!--[if lt IE 9]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <script src="js/respond.min.js"></script>
    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
      ga('create', 'UA-73425000-1', 'auto');
      ga('send', 'pageview');
    </script>
    </head>
    <body>
    <div class="gridContainer clearfix">
      <div id="div1" class="fluid">
        <div id="test1" class="fluid ">This is the content for Layout Div Tag "test1"</div>
       <div id="test2" class="fluid ">This is the content for Layout Div Tag "test2"</div> 
    </div>
    </body>
    </html>

  • How to declare ftp in File class. I want to display filename of file in FTP

    How to declare ftp in File class. I want to display filename of file in FTP server.
    I try
    File f2= new File("ftp://abc:abc1111@ABC/file");
                   String n[] = f2.list();
                   System.out.print(n[0]);
                   Vector filename = null ;
                   for (int i2 = 0; i2 < n.length; i2++) {
                        filename.add(n[i2]);
    but it is not work
    Thank you.

    You can use Jakarta's net-package to connect to a FTP server.
    Download it here:
    http://jakarta.apache.org/site/downloads/downloads_commons-net.cgi
    Here's a small demo:
    import org.apache.commons.net.ftp.*;
    public class FTPTest {
        private boolean isConnected;
        private FTPClient client;
        public FTPTest() {
            isConnected = false;
            connect();
        private void connect() {
            String server = "server.org";
            String username = "user";
            String password = "password";
            client = new FTPClient();
            try {
                client.connect(server);
                client.login(username, password);
                String[] files = client.listNames();
                for(int i = 0; i < files.length; i++) {
                    System.out.println(files);
    isConnected = true;
    disconnect();
    catch(Exception e) {
    e.printStackTrace();
    private void disconnect() {
    if(isConnected) {
    try {
    client.disconnect();
    isConnected = false;
    catch(Exception e) {
    e.printStackTrace();
    public static void main(String[] args) {
    new FTPTest();

  • I want to open a radio file that is .rm.  I get a message that says I need additional Quicktime software, but I cannot locate what I need to download on the QT website.  Anyone got ideas about how I can open this file?

    I want to open a radio file that is .rm.  I get a message that says I need additional Quicktime software, but I cannot locate what I need to download on the QT website.  Anyone got ideas about how I can open this file?

    Hi bert,
    the ".rm" extension is created by 'Real Media' application.
    The easiest way to use it is to install the 'Real Media' player:
    1. RealPlayer BBC.app
    2. RealPlayer 12.app
    I have both installed & use them sometimes.
    (The 'BBC' wersion doesn't have any adverts with-in the app.)

  • Why does Dreamweaver upload a blank page when i "put" a .php or .html file that I just edited. It's

    Why does Dreamweaver upload a blank page when i "put" a .php or .html file that I just edited. It's like Dreamweaver isn't putting the complete file. So when i check my work (refresh the page), it is now blank. This happens about 50 percent of the time and can occur with any of the websites I maintain. (If I pull out my macbookpro, i can edit and upload the page, but the screen is smaller and i would rather be at my desktop). I am using CS5 on a MacPro, operating system 10.7.5.

    I've never heard of that type of error before. If it were happening to me, here are a few things I would do...
    Verify it's DW
         Download Filezilla (free and very nice in reality) and make sure it uploads correctly from there to rule out connection issues
    Rebuild Site Cache
         From the Files window of your site, click the menu and go to Site > Recreate Site Cache
    Delete DW File Cache
         If the above does nothing, I'd kill my DW Cache File: http://forums.adobe.com/thread/494811
    Uninstall, clean, reinstall
         Uninstall the program, use the cleaner tool here: http://www.adobe.com/support/contact/cscleanertool.html to kill everything (Adobe leaves behind things that are picked up again in a normal uninstall/reinstall) then reinstall it.

  • I want to ask about deleting files that have been deleted in the trash but I want to remove it permanently from the trash can not

    I want to ask about deleting files that have been deleted in the trash but I want to remove it permanently from the trash can not, indeed I delete files that are partly contained in the application file. I want to delete files that are also quite a lot by 5 Gyga, I've tried to remove it from the normal trash remains are not removed. How should I do?

    +

  • Hello, I bought the MY BOOK LIVE by WD. I did setup, according to the instructions. I stored video files in Live Book. When I opened up video file, that I stored in the MY BOOK LIVE folder, it didn't play well. It started play slow an frizzed. Please help

    Hello, I bought the MY BOOK LIVE by WD. I did setup, according to the instructions. I stored video files in Live Book. When I opened up video file, that I stored in the MY BOOK LIVE folder, it didn't play well. It started play slow an in a few seconds freezed. Why? How can I fix it?
    I wanted to buy the external hard drive storage, instead they sold me a sever storage and it doesn't work well.
    Should I return it? What shoud I get instead?
    Please help!
    thank you so much!

    Hello, I bought the MY BOOK LIVE by WD. I did setup, according to the instructions. I stored video files in Live Book. When I opened up video file, that I stored in the MY BOOK LIVE folder, it didn't play well. It started play slow an in a few seconds freezed. Why? How can I fix it?
    I wanted to buy the external hard drive storage, instead they sold me a sever storage and it doesn't work well.
    Should I return it? What shoud I get instead?
    Please help!
    thank you so much!

Maybe you are looking for