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

Similar Messages

  • Opening a new browser window always puts a flv-file (0bytes of a youtube vid viewed earlier) on desktop. Firefox 18.02

    Opening a new browser window always puts a flv-file (0bytes of a youtube vid viewed earlier) on desktop. Firefox 18.02
    viewed the yuotube vid yesterday. deleted all the flv-files on the desktop.
    same thing today, a new window always puts the same empty file from yesterday.
    any suggestions?

    You can check the home page setting:
    *Tools > Options > General > Startup: Home page
    *https://support.mozilla.org/kb/How+to+set+the+home+page
    You can check for problems with the sessionstore.js and sessionstore.bak files in the Firefox Profile Folder that store session data.
    Delete the sessionstore.js file and possible sessionstore-##.js files with a number and sessionstore.bak in the Firefox Profile Folder.
    *Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    Deleting sessionstore.js will cause App Tabs and Tab Groups and open and closed (undo) tabs to get lost, so you will have to create them again (make a note or bookmark them).
    *http://kb.mozillazine.org/Multiple_profile_files_created

  • Create new external window and displays the viewdata as pdf?

    Hi,
    I have developped an application that will display some textviews and one table that displays 5 records,
    for this I want display as new External window and dispay in PDF the data what we have in view.
    advise me how to approach for external window and diplay as PDF.
    Thanks,
    Lohi.
    Message was edited by:
            Lohitha M

    Thanks for your reply,
    Here my problem is now I am getting the table values as output in the Jsp.
    In Jsp I want to create Button when I click that button I need to display an external window and display the table data what ever is available that will display new external pdf.
    I have developped the applcation by using of the three files table.java,tablebean.java,table.jsp and in portalapp.xml cretated the component.
    Now  how can I perform my action in that existed Jsp page and how to display extenal window i that how to generate the PDF.
    I am in learning stage in this.
    please elobarate with atleast some snippests.
    Thanks,
    Lohi.
    Message was edited by:
            Lohitha M

  • When I open a new firefox window, and click the + to open a new tab, my first page disappears - I can only seem to return to it by closing all the other tabs.

    The issue occurs like this:
    1. Open a new window
    2. Enter a URL and go to a page (any page).
    3. Click the + and open a new tab.
    4. The first tab is no longer visible in the tabs bar.
    5. I keep opening lots of other tabs and the first tab stays invisible (all the others stay visible / accessible).
    6. The only way I've found to return to the first tab is to close all my other tabs.
    This doesn't always happen (i.e. I can have two firefox windows open and only one of them does it!)
    I'm not sure if it's a feature or something? But it's very annoying!
    Any ideas welcomed.
    Thanks

    Hi - yes I can! I hadn't noticed that little arrow before, thanks.
    However I would really like to stop it hiding the first tab all the time.... Even when I navigate to the first tab using that "list all tabs" arrow, it still remains 'hidden' (i.e. I can't see a tab up the top, even when that tab is active. And when I navigate away from it to another tab, it is invisible again).
    Any ideas?
    Thanks

  • Open a new browser window to show document

    Hi,
    I am trying to click an item in datagrid to open a new
    browser window and display the document for this selected item. how
    to implement it? thank you.

    Here is a full example that should do what you are asking.
    You need to create an itemRenderer for your DataGrid.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    backgroundAlpha="0" >
    <mx:Script>
    <![CDATA[
    import mx.collections.*;
    private var catalog:ArrayCollection;
    private static var contacts1:Array = [
    {URL: "
    http://www.macromedia.com/software/dreamweaver/",
    Product: "Dreamweaver"},
    {URL: "
    http://www.macromedia.com/software/flash/",
    Product: "Flash"},
    {URL: "
    http://www.macromedia.com/software/coldfusion/",
    Product: "ColdFusion"},
    {URL: "
    http://www.macromedia.com/software/flex/",
    Product: "Flex"},
    {URL: "
    http://www.macromedia.com/software/breeze/",
    Product: "Breeze"},
    {URL: "
    http://www.macromedia.com/software/director/",
    Product: "Director"}
    private function initCatalog(cat:Array):void
    catalog = new ArrayCollection(cat);
    myDatagrid.dataProvider = catalog;
    public function generateHtml(url:String):String {
    return '<a href="'+url+'"
    target="_blank">'+url+'</a>';
    ]]>
    </mx:Script>
    <mx:Text text="This example uses a Text itemRenderer for
    the second column that
    changes the font color of those cells and uses the htmlText
    property of Text
    to make the cell a link." width="350" />
    <mx:DataGrid id="myDatagrid" width="600" height="300"
    creationComplete="initCatalog(contacts1)" >
    <mx:columns>
    <mx:DataGridColumn dataField="Product" />
    <mx:DataGridColumn dataField="URL" width="400">
    <mx:itemRenderer>
    <mx:Component>
    <mx:Text color="0x0000FF"
    htmlText="{outerDocument.generateHtml(data.URL)}"/>
    </mx:Component>
    </mx:itemRenderer>
    </mx:DataGridColumn>
    </mx:columns>
    </mx:DataGrid>
    </mx:Application>
    Joan Lafferty
    Flex SDK QA

  • I close Firefox session and then try to open a new browser window - get message that Firefox is still running and I need to shut down and restart. Need a solution

    I close a Firefox browser and at a later time want to open a new browser window but get message "Firefox is still running and I need to shut down before I can open a new session" I do not want to shut down as this is laborious - I can go into task manager and processes and click on Firefox and end session that way but this is not the solution. Firefox seems to be running in background but I cannot open a new session window without doing on of the above.

    Have a look at this post, see if it is of any help (though related to Vista, but same issue can be there with Window 7 also)
    http://www.vistax64.com/browsers-mail/265937-firefox-exe-still-running.html

  • Open discoverer report in new browser window and without connections page

    Hi All,
    We are using Oracle 11g Discoverer 11.1.1.4.  Requirement is to open the discoverer report in a new browser window and without connections page.
    When we are running discoverer reports with this parameters we unwantedly get the connections page of the discoverer plus which we don't want.
    Went through the documentation given in this page and followed it still the issue persists, and i see couple of threads with my issue and no updates.
    This excerpt is from the documentation available in the link
    " _plus_popup=true and framedisplaystyle=embedded launches Discoverer Plus in a new pop-up browser window that contains the Plus applet embedded in it "
    http://www.art2dec.com/documentation/docs/oas10g1012/linux/bi.1012/b13918/urlstart.htm
    and Here is what we use to invoke our reports.
    http://ipaddress:port/discoverer/plus?cn=cf_123&_plus_popup=TRUE&framedisplaystyle=EMBEDDED&wb=disc_wb_1
    Request the forum users from PRO discoverer group to help me out of this issue and expect a good discussion on this.
    Thanks in advance

    Closing the thread
    We were able to achieve by changing the browser settings in the IE 8 Browser. Disabled Tabbed browsing.

  • Want To Have Flash Project Open In New Browser Window

    Hi,
    My project outputs and plays perfect to Flash (let default to
    Flash 7) but when viewing it (via a link from a web page) it opens
    in a "next" window and at the end, if you use the X (EXIT) button
    from the player control bar it wants to close the browser window
    and does not take you back to the webpage (where I have the link to
    play). I cannot seem to find an option in the Preferences or during
    output to make the player open in a "new" browser window. Is it
    possible there is a browser setting for this instead of setting in
    Captivate? (IE 6 or 7) Thanks for any help/suggestions!

    Hi leh1, and welcome to the User Community for Captivate!
    The window in which any content plays is determined by the
    code contained for the link,
    in the web-page from which it is launched. In a nutshell,
    you add these parameters to the link when it is created in the
    "Parent" window.
    Below is a snippet from a Menu Builder project in which the
    links to "Project1" and "Project2" are set to open in a "New"
    window, without chrome (note the many "
    =no" following an equal sign), at a size of 720 pixels by
    540 pixels ... the snip below shows a link to "Project1.htm", a
    document containing a Captivate movie. I have bolded the specific
    entries that control the type window ("OpenCustomLink") and the
    size of that window ("width=720,height=540"):
    <P style="cursor: pointer; cursor: hand; position:
    absolute; left: 90px; top: 149px; text-decoration: none; font:
    normal 18pt Arial; color: #000000" title="Project 1" onclick="
    OpenCustomLink('project1.htm', '_blank',
    'scrollbars=no,status=no,
    titlebar=yes,toolbar=no,menubar=no,location=no,resizable=yes,
    fullscreen=no,
    width=720,height=540'); "
    onmouseover="this.style.color='#0000FF'; "
    onmouseout="this.style.color='#000000';">Project 1</P>
    (some spaces inserted to avoid horizontal scroll)
    All of which is to say, the target window is controlled from
    the link in the parent document. I wouldn't suggest you just
    copy-paste the above code, as I took liberties with it. I
    would suggest that you can do this yourself with your own
    HTML editor (Dreamweaver, etc.), or even better, get your local
    web-guru to do it for you.
    All the best!!
    .

  • How to open a new browser window without toolbar, location, and menu bars from AIR?

    I have the following problem in my Flex+AIR application. I need to embed an ActiveX component that has JavaScript API inside my application. I tried to embed it inside <mx:HTML> component but unfortunately, AIR doesnot support plug-ins or ActiveX controls. So I've decided to open it in a new browser window. I tried navigateToURL(...) method but it has two problems - it is opening a new tab in the existing browser window and there is no way for me to configure the new browser window appearance, like removing toolbar, menu bar, location bar, etc. Then I tried to open a new window from JavaScript running inside <mx:HTML> component using window.open(...) API but it doesn't open a new window at all.
    Is there any way for me to open a new browser window without toolbar, location bar, etc. (which will run ActiveX control, so it cannot be AIR window) from inside AIR?
    Best regards,
    Arkady.

    Is it possible to open a new browser window using JSP?a JSP page is also an HTML page, this is client side stuff, you can do it with JavaScript.

  • I can open a new browser window, but not a new tab, neither by clicking the plus or selecting it from the menu. I have fully updated firefox and also restarted. what's going on?

    I can open a new browser window, but not a new tab, neither by clicking the plus or selecting it from the menu. I have fully updated firefox and also restarted. what's going on?

    I have the same problem with the right click and do not have the ask toolbar installed on my system?

  • JavaScript for opening a new browser window.

    Hi all,
    Let me start by saying that I'm not JavaScript savvy at all.
    I have two buttons on a slide and I want each to open a new browser window.
    I Googled for a script and found this:
    window.open ('URL')
    I tried in my project and it worked fine but the browser window that my project was running in also changed.
    I've attached a .gif image of what happens to my project window when either of the two buttons is clicked.
    Can anyone help??

    You can check the home page setting:
    *Tools > Options > General > Startup: Home page
    *https://support.mozilla.org/kb/How+to+set+the+home+page
    You can check for problems with the sessionstore.js and sessionstore.bak files in the Firefox Profile Folder that store session data.
    Delete the sessionstore.js file and possible sessionstore-##.js files with a number and sessionstore.bak in the Firefox Profile Folder.
    *Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    Deleting sessionstore.js will cause App Tabs and Tab Groups and open and closed (undo) tabs to get lost, so you will have to create them again (make a note or bookmark them).
    *http://kb.mozillazine.org/Multiple_profile_files_created

  • How do i open a new browser window(IE or Netscape)?

    I need to open a new browser window to show a web page returned by a PHP aplication.
    If i use an editorpane the returned page is shown unformatted.
    PLEASE HELP!
    Rui

    or to open a window using a hyperlink, u can try this:
    Link Name
    This will open a window and send then send u to the page you want for processing.

  • Open a new browser window when click a button

    Hi,
    I am working on Apex - 3.2.0.00.27.
    I want that when I click on a button, it should open a new browser window. I have tried to set property on the button , direct to url , html = _blank.
    but somehow it is not working.
    can you suggest something ?
    Thanks in advance.
    -Jasmine

    Hi,
    Even if i create different regions , it is not possible for me to place them between items.
    But anyways, I created a separate button in the same region and it works fine.
    Thanks Jari for your help.
    -Jasmine

  • How can I save my customised toolbar so it is there every time I open a new browser window

    I have created a customised toolbar with all the icons I want but have to do it again every time I open a new browser window.

    i found i had almost exactly the same problem as you. one evening my itunes just wouldn't start up, it told me that 'itunes is unable to open because some of it's required files are missing, please re-install itunes'. now, i personally know a lot on the subject of computers and how they opperate, i had the built the computer that i encoutered the problem on myself. as soon as i came across the problem, i immediatly thought that i would be able to simply uninstall itunes and quicktime, and then re-install.
    after doing this, nothing changed, i went straight to 'add or remove programs' in windows, and tried to remove itunes from there. it wouldn't uninstall. i racked my brains over the problem, until i found this article, which provided a great deal of help. for anyone who later has this problem, go and download this freeware from microsoft: http://support.microsoft.com/default.aspx?scid=kb;en-us;290301 this program will immediatly remove any unwanted programs with ease, whether they are running or not. after using this program to uninstall itunes, re-install, and your problem should be solved.
    thanks. Alex Dove
    Custom built pc   Windows XP  
    Custom built pc   Windows XP  

  • How to open a new browser window from a JSP page?

    Hi,
    I am picking up records from the database and displaying each record in a seperate text area field using the JSP code. I should be able to display the content ( available in the text area) in a seperate window if the user clicks on one icon.
    Is it possible to open a new browser window using JSP? If yes, how can I write information on the new browser window?
    Thanks in advance.

    Is it possible to open a new browser window using JSP?a JSP page is also an HTML page, this is client side stuff, you can do it with JavaScript.

Maybe you are looking for

  • Font Smoothing, FileMaker Pro 8 and my new MBP 17

    I have a Filemaker database I designed with white text on dark blue background and other dark colors. When OS X first introduced font smoothing the white was no longer solid but kind of disappeared into the background. The white color was uneven. Pla

  • Code Templates in SQL Developer 2.1

    Hi all! Looks like this feature does not work at all. Even followed the instructions from Sue's book page 99: In SQL Developer 2.1, simply start typing the code from the template, and the full code is displayed in the code insight drop list. Select t

  • How do I add my products to my Community emails when I respond to a question

    Can anyone tell me how to automatically add my Apple products to my community emails, I'm usually resonding?  I have them set-up in my profile.

  • Airplay mirroring with 2012 macbook pro ATV3 lagging

    Hey! Just went out and bought a appl tv gen 3 for my new macbook pro 13" Boy was I surprised by the lousy quality when turning on airplay mirroring...my wireless setup consists of a airport express (the older version) and the Apple tv. I tried mirror

  • Necessary SQL Server components

    Good day i have on different machines SharePoint2010 and MS SQL 2008 r2. A machine with the SQL is dedicated to SharePoint, so nothing else uses it. There are a number of services on the SQL server which i'd like to stop. Here they are: SQL server in