Viewing HTML Pages

I used JEditorPane and JTextPane to show HTML Pages, but it did not work with the hyperlink texts. How do I solve this problem.

You have to add a hyperlinklistener to handle user interactions.
Code sample comes from http://www.exampledepot.com/
   try {
        String url = "http://java.sun.com";
        JEditorPane editorPane = new JEditorPane(url);
        editorPane.setEditable(false);
        editorPane.addHyperlinkListener(new MyHyperlinkListener());
    } catch (IOException e) {
    class MyHyperlinkListener implements HyperlinkListener {
        public void hyperlinkUpdate(HyperlinkEvent evt) {
            if (evt.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
                JEditorPane pane = (JEditorPane)evt.getSource();
                try {
                    // Show the new page in the editor pane.
                    pane.setPage(evt.getURL());
                } catch (IOException e) {
    }

Similar Messages

  • Viewing HTML page saved  on the server from the browser

    Hi all
    In my application i am having some HTML pages saved on the server. I had given an option to the user to view the HTML page from my application. behind the scene what i am doing is that the view request will get handled by a servlet and from that servlet iam locating the HTML page on the server directory and sending the HTML page to browser by using the Servlet OutputStream. The HTML page is shown on the browser but the attached images are not shown. The images are also there in the server directory and are refered in the HTML file correctly. When i directly open the HTML file then the images are shown correctly.
    Can anyone suggest wat's wrong there.
    The code i m using is
    ServletOutputStream out=response.getOutputStream();
                        if(format.equalsIgnoreCase("pdf"))
                             logger.info("Seleted format is pdf..\n");
                             response.setContentType("application/pdf");
                        else
                             logger.info("Seleted format is html..\n");
                             response.setContentType("text/html");
    String file = ReportingConstants.URL_GENERATEDREPORTS+reportPath+itemName;
    // file : HTML file absolute path as string.
                        URL url=new URL(file);                    
                        BufferedInputStream bis=new BufferedInputStream(url.openStream());
                        BufferedOutputStream bos=new BufferedOutputStream(out);
                        byte[] buff = new byte[2048];
                        int bytesRead;
                        while(-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
                             bos.write(buff, 0, bytesRead);
                             bos.flush();
                        }

    You have to undertsand how the browser handles images and other resources in a HTML page. In the HTML there is an image tag that has a url to an image which can be a reletive url or an absolute url (starts with a "/").
    If the url is a relative url the browser interprets the url as being relative to the url currently displayed in the address field discarding the last element of the url . So if the url in the address bar is http://www.myserver.com/myapp/mypage.html and the relative url is images/myimage.jpg, the browser will submit a request to the server for http://www.myserver.com/myapp/images/myimage.jpg
    Now let's say that you are call mypage.html from a servlet that has the url http://www.myserver.com/myapp/servlets/myservlet. Then when the browser tries to retrieve myimage.jpg it will use the url http://www.myserver.com/myapp/servlets/myservlet/images/myimage.jpg and since this is incorrect it will not be able to display the images.
    One solution to this is to change all of the image urls to absolute urls. That is the start with a slash where the slash represents the start of the url after the application domain name. For example you used an absolute url for myimage.jpg it would look like /images.myimage.jpg and when accessing the page through the servlet url (http://www.myserver.com/myapp/servlets/myservlet) the browser will discard everything after http://www.myserver.com/myapp and look for the image at http://www.myserver.com/myapp/images/myimage.jpg which is the correct url.
    A second solution is to use the HTML BASE tag which tells the browser not to interpret the image tag urls (and other resourses) using the current url in the address bar but to use the url supplied in the HTML BASE tag. The browser will still perform the same process for relative urls but now relative to the BASE tag url. Since the BASE tag url will be the same every time the page is accesssed the images should be correctly accessed no matter how the page is accessed (eg directly, using RequestDistpatcher or via your servlet)

  • Viewing html page of an applet

    I am trying to write an applet.
    When I viewed the html page for the first time,
    it worked fine.
    But now it doesnt work properly.
    All the contents are not shown.
    I recompiled my code but the mistake remains.
    Please help

    Probably need to refresh the web browser cache; usually the browser "Refresh" function will do that; or close ALL browser windows and then try it again.

  • View html page in forms 6i on the web

    Hi to all
    I want to view a html page in my form on the web, i try to use web.show_ocument, but it opens a page in another window. I'm working with oracle 9ias, and i can't use OLE and OCX. How can i open an html page in a frame (and not in onother window)?
    Plz HELP!!
    Thanks in advance

    Hi,
    if starting Forms in a HTML frame you can launch a HTML page to show in the same view. If e.g teh frame name for the HTML contect to show is "details" then you can do
    web.show_document("<URL>",'details');
    There also exists the IceBrowser class that knows how to render HTML pages. You ca add this in a PJC or as a Java Bean to Forms.
    http://www.icesoft.com/products/icebrowser.html
    Frank

  • How to view HTML page source in CR2011 CrystalViewer

    We are migrating from CR2008 SP3--> CR2011 (Unmanaged RAS SP5, OEM Edition 14.0.5.882)
    We have JSP page which wraps the CrystalViewer output between a ReportMenu page
    viewer.setOwnPage> FALSE Ensure that it is not generated with tags
    response.setBufferSize(4096);
    response.setContentType("text/html; charset=UTF-8");
    Writer out = response.getWriter();
    request.getRequestDispatcher("/webrpts/header.jsp").include(request,response);
    viewer.processHttpRequest(request, response, servletContext,response.getWriter());
    When we upgrade to CR2011, the viewer is showing the report in a BOX
    if we right click view Source, the report content are not shown.
    Is there any parameter to view the report source?
    I tried to print the output using viewer.getHtmlContent(request, response, servletContext);
    It does not output the Report Content....
    I am attaching a document to show how it is output in CR2008 and CR2011
    What is the difference between CR2008 and CR2011 Viewer?
    Please help.

    We are using JAVA SDK and already we are hiding the ToolBar by setting
    viewer.setDisplayToolbar(false);
    viewer.setToolPanelViewType(crToolPanelViewTypeEnum.none);
    The documentation says if
    viewer.setOwnPage(false);  then the <HTML></HTML> will not be generated by the
    viewer.processHttpRequest(....)
    But if I output the data generated by this method it does not have the report output....
    We are expecting that and process further using javascript
    What is the difference in behaviour of 2008 and 2011 Crystal Viewer?
    Previous flow explained below
    Ex
    <html>
    <head>.......
    <javascript...............>
    </head>
    <body onload=callCustom()>
    viewer.processHttpRequest(......)
    </body>
    </html>

  • 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 embed html page in bsp view

    Dear all,
    I would like to embed a html page (eg: www.google.com)  inside bsp view. I have used iframe to do this; but the iframe is getting refreshed everytime a button is getting clicked. Delta handling flag is also not working for iframe. Is there any other method to embed html in bsp view.
    Thanks and Regards,
    Manasi

    Hi Shreya,
    See if this <a href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/ep/_s-u/SDN%20Behind%20The%20Scenes%20-%20Embedding%20an%20EP%205.0%20iView%20in%20an%20HTML%20Web%20Page">link</a> helps.
                            OR
    You can create a JSP dynpage in portal application object.
    Along with this JSP and dynpage is created automatically. You can copy the html page and paste it in JSP page. To make it display, include a statement in JSP dynpage as
    this.setJspName("JSPname.jsp");
    For more info on this u can refer:
    http://help.sap.com/saphelp_nw04s/helpdata/en/95/cfa441cd47a209e10000000a155106/frameset.htm
    To get an idea of content development you can refer this <a href="https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2845">weblog</a>.
    Regards,
    Pooja.
    Message was edited by: Pooja S

  • Blank browser page when viewing html/swf exported from Indesign

    We've created a 'flip book' in Indesign and exported it as a swf and html docs. These docs both view correctly locally, but when uploaded into the same directory on our server and viewed via safari or chrome, they both appear as blank browser pages.
    html page is here: http://www.thinktankcd.com/SmartsquareBrochure_030215_test.html
    Any idea what we've done wrong?
    Indesign CC 2014  OSX10.9.2

    Thanks Sumit, but ID didn't create any other resources to go along with the swf and html files. Besides, it doesn't need to; there are no other resources but it still works locally. The swf is a stand alone file, the html just gives access to that file when accessed via a browser.

  • May by anyway view Local Network files[e-book] or videos or html pages, from the main PC

    In ipad 3 upgraded to 4 ios, may by anyway view Local Network files[e-book] or videos or html pages, from the main PC if, this main has local host[php/mysql] or, from the local network itself: eg //user/downloads/pdf/ebook1.pdf?

    In ipad 3 upgraded to 4 ios, may by anyway view Local Network files[e-book] or videos or html pages, from the main PC if, this main has local host[php/mysql] or, from the local network itself: eg //user/downloads/pdf/ebook1.pdf?

  • Pass Username to HTML Page Viewer

    Is there a way to get the current username passed to an HTML page viewer in SharePoint? Or is there a better way to do that? I have an aspx page I need to pass the username to.

    Hi,
    According to your post, my understanding is that you want to send the username from SharePoint to the webpage.
    We can use JavaScript Client Object Model to get the current username and through the URL to send the value.
    The following thread for you to take a look at:
    http://social.technet.microsoft.com/Forums/en-US/a425f091-85df-4e99-9f8b-ee474c21ac2e/pass-username-in-url?forum=sharepointgeneralprevious
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Using WEB Output HTML Gallery and uploading using ftp upload the HTML page views correctly but images only display the alt tag?

    Using WEB Output HTML Gallery and uploading using ftp upload the HTML page views correctly but images only display the alt tag in the browser window?

    After a little investigation, I discovered that PNGs also do not render correctly in IE7 in similar circumstances.
    I ended up using Levels in Photoshop to bring the output blacks up to "5", saved the images as PNGs, modified the HTML from .jpg to .png, and that seems to have covered up the problem well enough.
    By the way, I did confirm that IE8 beta 2 renders the images correctly.
    Brian

  • Can't install Updater and view my HTML page online!

    Hi all,
    I do have the most recent version of Macromedia Dreamweaver
    MX 2004 ver. 7.0.1. But I was trying to install the updater anyway.
    As I was trying to install the Updater I received a Severe Error
    message which says: "This folder does not contain Dreamweaver MX
    2004." This happens when I choose the destination as to where I
    should install the files. And I do have Dreamweaver installed on my
    machine. Although I probably don't need the updater, I wanted to
    install it because I am having problems viewing my html file (which
    embeds an swf) when I upload it to the server. I can view it
    locally but when I view the page online, it just hangs there
    forever.
    I sent my html file to someone else and she was able to
    upload it to her server and when I viewed her source code, I
    noticed that she had some JavaScript. When I asked her about it,
    she said that the JS file that's in the html was automatically
    added by Dreamweaver to overcome the Microsoft click to activate
    limitation. The script writes the Flash embed code to the page
    dynamically. That didn't happen for me, so I'm confused as why my
    html page which embeds Flash can't be viewed online correctly.
    Please help! Thanks!

    "This folder does not contain Dreamweaver MX 2004."
    That only means that it doesn't contain DW7.0 - which you
    already know.
    Since you have already updated to 7.0.1, this is the expected
    error message
    when you try to update again.
    > it just hangs there forever.
    Post a link to the page, please.
    > I sent my html file to someone else and she was able to
    upload it to her
    > server and when I viewed her source code, I noticed that
    she had some
    > JavaScript. When I asked her about it, she said that the
    JS file that's in
    > the
    > html was automatically added by Dreamweaver to overcome
    the Microsoft
    > click to
    > activate limitation.
    Not if you are using 7.0.1 it doesn't. A look at your page
    would reveal
    all, though.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "respondplease" <[email protected]> wrote in
    message
    news:[email protected]...
    > Hi all,
    >
    > I do have the most recent version of Macromedia
    Dreamweaver MX 2004 ver.
    > 7.0.1. But I was trying to install the updater anyway.
    As I was trying to
    > install the Updater I received a Severe Error message
    which says: "This
    > folder
    > does not contain Dreamweaver MX 2004." This happens when
    I choose the
    > destination as to where I should install the files. And
    I do have
    > Dreamweaver
    > installed on my machine. Although I probably don't need
    the updater, I
    > wanted
    > to install it because I am having problems viewing my
    html file (which
    > embeds
    > an swf) when I upload it to the server. I can view it
    locally but when I
    > view
    > the page online, it just hangs there forever.
    >
    > I sent my html file to someone else and she was able to
    upload it to her
    > server and when I viewed her source code, I noticed that
    she had some
    > JavaScript. When I asked her about it, she said that the
    JS file that's in
    > the
    > html was automatically added by Dreamweaver to overcome
    the Microsoft
    > click to
    > activate limitation. The script writes the Flash embed
    code to the page
    > dynamically. That didn't happen for me, so I'm confused
    as why my html
    > page
    > which embeds Flash can't be viewed online correctly.
    >
    > Please help! Thanks!
    >
    >
    >

  • Dreamweaver crashes when using Live View to preview SWF in HTML page

    I'm new to DW CS4 and I'm trying to insert an swf on a blank html page.  When I attempt to use "live view" to preview Dreamweaver crashes every time.  I can view the page when I preview in a browser though.  Is there something new in CS4 I'm missing?
    Please help!
    Thanks.
    BC

    sschroeder2013  You are not alone. I updated a while ago and went into Dreamweaver to update a site and I see the same problem above.
    Please let us know when you have repaired the problem.
    Thanks!

  • 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

  • I try to create an html for IPad. The html page contains an element overlapping a video, now it works as for view but the focus is still with video. This denies the event of overlapping element from occuring. Can please anyone help to solve this issue?

    I try to create an html for IPad. The html page contains an element overlapping a video, now it works as for view but the focus is still with video. This denies the event of overlapping element from occuring. Can please anyone help to solve this issue?

    Hello,
    '''Try Firefox Safe Mode''' to see if the problem goes away. Safe Mode is a troubleshooting mode, which disables most add-ons.
    ''(If you're not using it, switch to the Default theme.)''
    * On Windows you can open Firefox 4.0+ in Safe Mode by holding the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac you can open Firefox 4.0+ in Safe Mode by holding the '''option''' key while starting Firefox.
    * On Linux you can open Firefox 4.0+ in Safe Mode by quitting Firefox and then going to your Terminal and running: firefox -safe-mode (you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    * Or open the Help menu and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    [[Image:FirefoxSafeMode|width=520]]
    ''Once you get the pop-up, just select "'Start in Safe Mode"''
    [[Image:Safe Mode Fx 15 - Win]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    ''When you figure out what's causing your issues, please let us know. It might help other users who have the same problem.''
    Thank you.

Maybe you are looking for

  • How do you share a global between two programs over a LAN

    I want to share a global variable which 2 programs can use but each program resides on different computers on my LAN. I have tried by placing the global in each program in the normal way but if I open the global on each computer they do not correspon

  • Extractor for Order Details

    Hi All, I have a reuirement to extract Order Item qty. The logic is as follows - Go to table AFKO, enter material number and Scheduled Finish date (GLTRS) entered in initial selection screen and get the order numbers. Enter these order numbers in tab

  • Sd-examples

    hi, can anyone tell me real time scenario for individual purchase order as well as difference between scheduling agreement and contract ganesh Message was edited by:         ganesh ram

  • Is there any Security Feature available in any of ...

    Dear Everyone, very good day to you all Just checking for a security feature: 1. Is there a way to hide my Messages or can I set up a Personal password to prevent access from strangers? 2. Is there a way to hide my contacts list or can I set a passwo

  • [SOLVED] [Xorg] Samsung SM 2232BW

    Whell i am going nuts here. What i'm trying to do past two days is to make my monitor to play nice with my Geforce 9600GT graphics card (nvidia driver) on D-SUB over adapter but i cann't get it to run on native resolution (1680x1050). It just wonn't