How to generate dynamic HTML pages using Swing Application?

Hello,
I am writing a Java application to connect to a local light-weight java database. I would like to generate and present a HTML on the fly after selecting records from a database. At server side, I could easily use JSP/Servlet to do this. How can I do this on a desktop client machine using Java application? I do not want to install Apache web server on the desktop machine. Any help will be greatly appreciated. Thanks in advance.
Dominic

The way u need to generate your html pages depened on what u want to generate,
anyway what i can help with, is how to display a generated page.
u have to use JEditorPane with HTMLEditorKit and HTMLDocument to display any HTML.
also u can use the methods provided with the above objects to generate your html format.
I hope I helped.

Similar Messages

  • How to create dynamic HTML page using PL/SQL code in APEX.

    hello,
    I am woking on one APEX application in which i want to create one dynamic HTML page on button press using PL/SQL code.
    Thanks

    It is possible to create HTML page with dynamic content. One way would be creating hidden field (e.g. P1_HTML on page 1) with dynamic HTML and on button click you redirect to page 2 and pass P1_HTML item value to item P2_HTML on page 2. On page you must have PL/SQL region. You can then render your dynamic HTML with code:
    htp.p(:P2_HTML);
    Don use APEX URL for passing HTML value. Problem and solution is described here: http://blog.trent-schafer.com/2011/04/03/dont-pass-string-parameters-in-the-url-in-apex-its-a-bad-idea/
    Edited by: MiroMas on 3.2.2012 3:20

  • How to show an html page using JEditorPane in applet.

    I have never use jeditorpane with applet so i dont know how to show a html page.if you have some code or any example then please posted that.Thanks

    public class MyApplet extends JApplet{
        private JTextPane textPane = null;
        public void init(){
        HTMLEditorKit editorKit = new HTMLEditorKit();
        HTMLDocument  htmlDoc   = (HTMLDocument)editorKit.createDefaultDocument();
        textPane  = new JTextPane();
        textPane.setEditable(false);
        textPane.setEditorKit(editorKit);
        textPane.setContentType("text/html");
        textPane.setDocument(htmlDoc);
        Container c = getContentPane();
        c.add(new JScrollPane(textPane),    BorderLayout.CENTER);
        c.add(buttonPanel,                  BorderLayout.SOUTH);
        c.add(Box.createVerticalStrut(5),   BorderLayout.NORTH);     
        c.add(Box.createHorizontalStrut(5), BorderLayout.EAST);     
        c.add(Box.createHorizontalStrut(5), BorderLayout.WEST);
        public void setHtml(String html){
            // you should check the textpane's document to detrmine if there
            // is already text in there..if so, then clear the textpane text and then
            // set the new html...Note: JTextPane only show basic Html ..
            // not like a full blown browser
            textPane.setTextt(html);
            textPane.setCaretPosition(0);
    }

  • How to generate a html page when a button is pressed

    hi
    i have to generate a html page when a help button is pressed
    so please help me
    thanks
    shiva

    "touch index.html"
    Might not be what you're looking for but creates an html page.

  • How to generate a html page for a VI which is created by a vi template dynamically

    I have a executable which calls a VI template dynamically, say it is subvi.vit. A subvi1.vi is generated by the template. On my web server, I want to display the front panel of subvi1.vi. How can I generate its html file programmatically if I don't want to use CGI?
    Thanks for your reply. 

    Hi tst,
    Thanks for your fast response.
    I don't know how I could make this mistake to put the post under feedback board but let's keep it here because I don't know how to move it to LV board unless I start a new thread.
    I don't know if I could do it in wizard because subvi1.vi doesn't exist before the executable runing. I have to create a html file during running.
    I did generate a html file in wizard but I have to use subvi.vit to do the web publishing. When I log into web server http:\\localhost\subvi.html, I got error message "the requested VI is not loaded into the memory on the server computer". The reason is that the vi template subvi.vit was loaded dynamically, so it is not in memory any more once the VI reference is closed. But subvi1.vi is running now. I need to display subvi1.vi's real-time front panel.
    Did I clarify my issue?
    I would appreciate your help.
    regards,

  • How to display a HTML page using ABAP program.

    Hi all,
    I know that this is easy and possible too but I haven't worked on this kind yet. I need to display a screen/ABAP program like TCODE PPMDT, where an HTML page is to be displayed and on the click of the HTML links provided, I need to navigate to someother transaction codes.
    Cheers,
    Sam

    Hi,
    See this sample code
    REPORT ZTESTHTML .
    DATA: ok_code LIKE sy-ucomm,
          myurl(132).
    data: custom_container type ref to cl_gui_custom_container,
          myhtml type ref to CL_GUI_HTML_VIEWER,
          repid like sy-repid.
    DATA events TYPE cntl_simple_events.
    DATA wa_events TYPE  cntl_simple_event.
          CLASS lcl_event_receiver DEFINITION
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS NC_Handler
                FOR EVENT NAVIGATE_COMPLETE OF CL_GUI_HTML_VIEWER
                IMPORTING URL.
    ENDCLASS.
          CLASS lcl_event_receiver IMPLEMENTATION
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD NC_Handler.
        myurl = URL.
      ENDMETHOD.
    ENDCLASS.
    start-of-selection.
      set screen 100.
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
      CASE OK_CODE.
        WHEN 'BACK'.
          CALL METHOD myhtml->go_back
               EXCEPTIONS cntl_error = 1.
          if sy-subrc ne 0.
          endif.
        WHEN 'FORW'.
          CALL METHOD myhtml->go_forward
               EXCEPTIONS cntl_error = 1.
          if sy-subrc ne 0.
          endif.
        WHEN 'STOP'.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
        WHEN 'REFR'.
          CALL METHOD myhtml->SHOW_URL
               EXPORTING
                  URL = myurl
                  IN_PLACE = 'X'
                  FRAME = ''
               EXCEPTIONS
                  CNTL_ERROR = 1
                  CNHT_ERROR_NOT_ALLOWED = 2
                  CNHT_ERROR_PARAMETER = 3
                  DP_ERROR_GENERAL = 4.
        WHEN 'OTHERS'.
          CALL METHOD CL_GUI_CFW=>DISPATCH.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'MENU'.
      if myhtml is initial.
        CREATE OBJECT custom_container
           EXPORTING
              CONTAINER_NAME = 'CONTAINER1'
           EXCEPTIONS
              CNTL_ERROR = 1
              CNTL_SYSTEM_ERROR = 2
              CREATE_ERROR = 3
              LIFETIME_ERROR = 4
              LIFETIME_DYNPRO_DYNPRO_LINK = 5.
        CREATE OBJECT myhtml
           EXPORTING
              PARENT = custom_container
           EXCEPTIONS
              CNTL_ERROR = 1
              CNTL_INSTALL_ERROR = 2
              DP_INSTALL_ERROR = 3
              DP_ERROR = 4.
        wa_events-eventid = CL_GUI_HTML_VIEWER=>M_ID_NAVIGATE_COMPLETE .
        wa_events-appl_event = 'X'.
        APPEND wa_events TO events.
        CALL METHOD myhtml->set_registered_events( events = events ).
        SET HANDLER lcl_event_receiver=>NC_Handler FOR myhtml.
        CALL METHOD cl_gui_cfw=>flush
             EXCEPTIONS cntl_system_error = 1
                        cntl_error        = 2.
      endif.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    Svetlin

  • How to call an HTMl page using URL in OAF?

    Hi,
    There is a page that has a toolbar. There we have to provide a help menu in which we need to display a customized html page. Therefore, we need to set the URL property in such a way that it should map to the path where this HTML file is located.
    Kindly provide a solution.

    Create a JSP page. Put your HTML code inside it. Place the JSP page under OA_HTML directory in server.
    Mention the JSP page name in destination URL property of the link item.
    -ANand

  • How to add xyz.html page to swing container?

    Hi,
    can any one help me to embed a html file in swing container. i am new to swings.
    Thanks,
    Sai.

    It's called "Swing", we have a forum dedicated to that, and try JEditorPane.

  • Include html page in htmldb application

    Hi,
    How to include an html page in htmldb application?? I have an external html page and I want to include it in my HTMLDB application.
    tks

    Is the parent file named with an *.shtm(l) extension?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "matthew stuart" <[email protected]> wrote
    in message
    news:g7hd6v$e53$[email protected]..
    >I know how to do an include of an HTML page inside an ASP
    page, but I am
    > basically trying to do the same thing with an HTML page
    - that is include
    > HTML
    > within HTML - but it doesn't seem to be working when I
    test in a browser.
    > It
    > displays fine in DW though!
    >
    > The only way to successfully create an include in HTML
    pages seems to be
    > to
    > use the library method.
    >
    > Here is my include code:
    >
    > <!--#include file="../_includes/footer.html" -->
    >
    > Is this wrong for an HTML page?
    >
    > Thanks
    >
    > Mat
    >

  • How to create hyperlink in Html page using Java

    Hello every one
    I want to know that how can I create a hyperlink in Html page using java ?
    Let for example
    I have code like this and i want to give hyperlink to it using java.
    rember that i am creating node using this id="name" which give me multiple value. and i want to assign diff link to each name..?
    <tr>
    <td ><span id="name"></span>
    </tr>

    but i m using this code to create node in html file
    HTMLLIElement li = (HTMLLIElement)appHTML.createElement("LI");
    Text txt = appHTML.createTextNode(name);
    li.appendChild(txt);
    appHTML.getElementById("name").appendChild(li);
    this will display all name value which is coming from database,
    and i want to assign a hyperlink to it,
    I have id with name also so I thought that using id i will
    create javascript like
    function popup(id)
         if(id==1)
              var n1 = window.open("../list/name1.html");
         if(id==2)
              var n1 = window.open("../list/name2.html");
    this way i want to popup particular file if i can pass id value in this function
    so want hyperlink like
    name

  • How to create a popup window to load HTML page in AIR application without using any mx or spark?

    How to create a popup window to load HTML page in AIR application without using any mx or spark components?
    I need to load the HTML page in popup in AIR application without using any of the <mx> or <spark> components. I need to open in the application itself not in the browser.(If we use navigateToURL() it will open in th browser)

    Can we achieve this? can somebody help me on this scenario..

  • How can I generate a html page in a servlet-applet connection?

    Hello, I have an applet which contains an ok button, when I click this button, I need that servlet generate an html page and view it in browser. How can I do this?
    Thanks

    But with this method only is possible I think open a page web, and if it is possible call url of the servlet, you generate other request and response object (other call to method doGet or doPost because ShowDocument needs parameter url), so the previously request when I click button ok it's no the same and how I obtain the prinwriter from first request, showDocument don't obtain html page from printwriter.

  • How to embed jnlp file into html page using object tag

    hi everyone,
    i have written one jnlp file like this.
    <?xml version="1.0" encoding="utf-8" ?>
    <!-- JNLP file for Demo applicaion -->
    <jnlp spec="1.0+" codebase="http://localhost:9080/base/" href="SampleExample.jnlp">
         <information>
              <title>Demo Application</title>
              <vendor> </vendor>
              <description>Sample Demo Application</description>
              <offline-allowed/>
         </information>
         <security/>
         <resources>
              <j2se version="1.3+" />
              <jar href="common.jar" main="true" download="eager" />
              <jar href="classes12.jar" download="eager" />
              <jar href="toplink.jar" download="eager"/>
              <package name="com.applet.*" part="applet" recursive="true"/>
         </resources>
         <applet-desc name="grid" main-class="com.applet.PriceGrid" width="1000" height="300"/>
    </jnlp>
    i am trying embed that jnlp file using object tag like
    <OBJECT
    classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH="1000" HEIGHT="300" NAME="grid">     
    <PARAM NAME="jnlp" VALUE="http://localhost:9080/base/SampleExample.jnlp">
    </OBJECT>
    but i am not able to load the applet using Web Start.
    Can anyone please help me. This is very Urgent for me.
    Thanks & Regards,
    Shiva.

    thanks.
    i am giving my problem clearly. i have one applet. Previously i am loading the applet in my html page using object tag like this...
    <OBJECT
    classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH="1000" HEIGHT="300" NAME="grid">
    <PARAM NAME="CODE" VALUE="com.adp.base.applet.PriceGrid.class" >
         <PARAM NAME="ARCHIVE" VALUE="common.jar,classes12.jar,toplink.jar" >
         <PARAM NAME="NAME" VALUE="grid" >
    <PARAM NAME="type" VALUE="application/x-java-applet">
    <PARAM NAME= "cache_option" VALUE ="no">
    </OBJECT>
    now what i need to do is
    i need load the applet only first time using web start and when ever the applet code changes in the server i need to reload the applet.
    for that i kept all the applet resources in .jnlp file.i want to cache all the resources which are in .jnlp file and applet must be displayed within a web page within a browser.
    Webstart always open a new application windows.
    I need to run an Applet embedded within a web page within a browser.
    Is there a way to still use Webstart?

  • How to generate individual HTML files from linked help?

    Hi folks,
    I'm trying to figure out how to generate individual web pages - based on heading types - from a help project this is linked to a FrameMaker book.
    I'm linking to the FM book, rather than importing, because the import process ruins my graphics. So, I know how to create individual web help pages using the import process; but that's not an option for me. (The graphics issue is a whole other discussion, which I've since given up on.)
    So, I'm using TCS 3.5 (RH9 and FM10). I've successfully linked to the FM book. Each topic represents a complete chapter and includes a single Heading 1 for the title and several Heading 2's. Again, these are all in the same help topic because I'm linked to the FM book.
    What I want to do is generate the web help so that new web pages (files) are created. In other words, I want breaks before each Heading 2. I want the resulting web pages to be named based on the Heading 2.
    Is this possible?
    Thanks for reading,
    Tom

    I’m not sure I understand the problem (I’m using FM 10, RH9, TCS3):  You can adjust .isf and all Conversion/CSS mapping, etc settings for an existing project (Linked or Imported) at:
    File > Project Settings > FrameMaker Document > Edit Conversion settings for FrameMaker documents: (click Edit button).
    Then, Go to FrameMaker Settings > Paragraph > Heading 1 etc. and click the box for Pagination.
    What I don’t know is if you have to re-do your linking process from scratch to do your pagination settings right the first time (like create a new project with your Frame docs, which shouldn’t be hard to test if you have saved your CSS, Master Pages etc), or already have an .isf file  with proper settings that you can specify at time of first import/linking. I already had these in place when I set up my linked project of a Frame book with 13 chapters – 350 pages – resulting in over 300 separate HTML files/topics (set H1, H2, and H3 levels to paginate). I don’t know if you can change these things post-linking, but it can definitely be done!
    There is definitely no reason to have to have an entire FM chapter as one topic in RH. You may have to create a new project to achieve your desired results, I am not sure.
    I hope this is helpful. Regarding RH ruining your images, I know what you mean. Through a painstaking process of research, trial, and error, I found that these Image options in the Conversion Settings produced the best results for me, though not as good as “ideal:”
    ·         Check the box for “Use Distiller to Generate Image”
    ·         Leave the “Do Not Regenerate Images” and “Preserve 3D Images” boxes unchecked
    ·         Under Preferred Dimensions: Check “Maintain Aspect Ratio” and check Width and Height – Set both to 0pt. (*This one was a key tip.) Leave “Scale” unchecked. (Scaling seems to do terrible things in RH.)
    ·         I left the Max Dimensions settings unchecked.
    ·         Set my personal preferences for margins (2pt all sides) and borders (solid, gray, 1 pt)
    ·         Under Advanced, Default format of PNG with color bit depth of 24. My graphics are all screenshots, so this is the reason for this in my instance.
    Regards,
    Virginia

  • Servlet to generate  *new*  html pages for browser

    Dear all,
    Greetings!
    I am write a servlet, and I want this servlet to generate different html pages (say 5 pages) simultaneously, and then display them in 5 different pages in client browser.
    The sequence is like this:
    1) the user click a link in a web browser and send request to web server.
    2) web server has a servlet to handle this request, then in doGet() or doPost() method it will do some calculations first, after that, it generate 5 different html pages (it can use redirect in a chain fashion) and send back to client browser.
    3) the client browser will display these 5 different html code in 5 different pages (should not be the same as the original pages that submited the request), i.e, it will pop up new web pages automatically to serve 5 different pages (since each page will have <html> ... </html> codes).
    Any solution, if possible, please give me some idea.
    //-- My main problem is: how to ask servlet to generate html codes,
    //-- and when send back to client, let browser displays the information in
    //-- a new web page (not original page the submit the request)? show some servlet doGet() code if possible.
    if you have solution for even only 1 page, your help is also very appreciated!
    once again, many thanks!

    However, for wild guessing,
    are you included d:\richard in your CLASSPATH?No. Does the CLASSPATH affect the default directory to create file - and I have to put the Tomcat as the first path in my classPath? But I just found that I set environment variable HOME to be d:\richard. It must be the reason.
    How about this:
    When a use submit a request, the servlet starts a new
    thread to do the process, for example.....I thought about this solution earlier. It is true that this is a solution. Now I am not worrying about it, since when I move on about this project, I found something more interesting (worse?) for this project. Detail follows:
    This morning I was informed that the project needs the request being sent from the front end applet, (*NOT from browser link*), so now even simple client side scripting does not work. This is because when servlet sends back response, it will send back to applet by Connection.getInputStream() - this is what I can think about right now. Basically, it means, the browser will not even have a chance to process the returned HTML code. So the question becomes: How to ask browser open a web page to display the servlet response from an front end applet directly? ;(
    I am almost run out of idea! Will check back later, meanwhile spend some more time considering... It is very late here now (early in the next morning)!
    Thank you very much indeed for all you kind help!!!

Maybe you are looking for

  • How to remove default comment from XML output

    Hi, I have a requirement to generate the XML report with XML output(Not PDF). Everything is working fine except I am getting one comment line "<!--Generated by Oracle Reports version 6.0.8.28.0--> which is not required and I want to remove this line.

  • No Airplay from my iPhone 5

    Hi I am unable to play movies from my iphone 5 to my Apple TV. I get the image of the first frame of the iphone movie onto the screen, but then nothing happens.  If I touch the phone screen, the image returns to the phone. Not sure what other informa

  • Firefox 4 toolbar layout creates a disaster on Firefox

    From Beta 1 to RC, the toolbar layout button has always destroyed the toolbar -- adding toolbars not selected, removing nearly all of the toolbar icons. Its changes are irreversible. The only recovery is to open Firefox 3.x, rebuild the toolbar, clos

  • Mail Retrieval Problem

    I moved my Mail file from Applications to Documents, and when I realized I could not get my new or old mail by clicking on the Mail Icon, I then moved my Mail folder back from Documents to Applications. But unfortunately, I still cannot retrieve my m

  • Can someone please downsave a file for me please?

    Hi Everybody Someone created a menu for us in CS6 and I can open in CS 5.5 but when I do all the text shows up as separate lines so it is hard to edit. Can someone please downsave it for me so I can see it like a normal file? I would be forever grate