Internal web server and browser

Discussion in 'Java' started by carmelo, Jul 21, 2008.

  1. carmelo

    carmelo Guest

    Hi there,
    I need to make an application with an internal browser and an internal
    web server. Do you know anything that can help for this purpose?
    When you open the Eclipse help, you can see that it uses an internal
    browser and an internal http server... I need something similar...
    What do you suggest to start?


    Thank you very much in advance
    Carmelo
     
    carmelo, Jul 21, 2008
    #1
    1. Advertising

  2. carmelo wrote:
    > Hi there,
    > I need to make an application with an internal browser and an internal
    > web server. Do you know anything that can help for this purpose?
    > When you open the Eclipse help, you can see that it uses an internal
    > browser and an internal http server... I need something similar...
    > What do you suggest to start?
    >


    Start here:
    http://java.sun.com/docs/books/tutorial/uiswing/components/html.html

    I can't see why you need an internal HTTP server, since for an
    application to communicate with itself using HTTP is pointlessly
    complex. I'd store the HTML as text files in a JAR or in a directory
    created when the app is installed.

    --
    RGB
     
    RedGrittyBrick, Jul 21, 2008
    #2
    1. Advertising

  3. carmelo

    Mark Space Guest

    carmelo wrote:
    > Hi there,
    > I need to make an application with an internal browser and an internal
    > web server. Do you know anything that can help for this purpose?
    > When you open the Eclipse help, you can see that it uses an internal
    > browser and an internal http server... I need something similar...
    > What do you suggest to start?
    >
    >
    > Thank you very much in advance
    > Carmelo


    Can Eclipse be used as a platform like NetBeans can? I'd look into
    that. If Eclipse has a working browser and server that does what you
    want, you may be able to use those components directly.
     
    Mark Space, Jul 21, 2008
    #3
  4. RedGrittyBrick wrote:
    > carmelo wrote:
    >> Hi there,
    >> I need to make an application with an internal browser and an internal
    >> web server. Do you know anything that can help for this purpose?
    >> When you open the Eclipse help, you can see that it uses an internal
    >> browser and an internal http server... I need something similar...
    >> What do you suggest to start?
    >>

    >
    > Start here:
    > http://java.sun.com/docs/books/tutorial/uiswing/components/html.html
    >
    > I can't see why you need an internal HTTP server, since for an
    > application to communicate with itself using HTTP is pointlessly
    > complex. I'd store the HTML as text files in a JAR or in a directory
    > created when the app is installed.
    >

    You would need an (internal?) HTTP server if you are serving dynamic
    content.
     
    Abhijat Vatsyayan, Jul 21, 2008
    #4
  5. Abhijat Vatsyayan wrote:
    > RedGrittyBrick wrote:
    >> carmelo wrote:
    >>> Hi there,
    >>> I need to make an application with an internal browser and an internal
    >>> web server. Do you know anything that can help for this purpose?
    >>> When you open the Eclipse help, you can see that it uses an internal
    >>> browser and an internal http server... I need something similar...
    >>> What do you suggest to start?
    >>>

    >>
    >> Start here:
    >> http://java.sun.com/docs/books/tutorial/uiswing/components/html.html
    >>
    >> I can't see why you need an internal HTTP server, since for an
    >> application to communicate with itself using HTTP is pointlessly
    >> complex. I'd store the HTML as text files in a JAR or in a directory
    >> created when the app is installed.
    >>

    > You would need an (internal?) HTTP server if you are serving dynamic
    > content.


    No you wouldn't.

    Your scenario

    1 App user clicks on link
    2 App creates HTTP request
    3 App receives HTTP request
    4 App generates HTML dynamically
    5 App sends HTTP response
    6 App receives HTTP response
    7 App displayes generated HTML in Swing widget

    My scenario

    1 App user clicks on link
    4 App generates HTML dynamically
    7 App displayes generated HTML in Swing widget

    --
    RGB
     
    RedGrittyBrick, Jul 22, 2008
    #5
  6. carmelo

    carmelo Guest

    On 22 Lug, 10:57, RedGrittyBrick <> wrote:
    > Abhijat Vatsyayan wrote:
    >
    > No you wouldn't.
    >
    > Your scenario
    >
    > 1 App user clicks on link
    > 2 App creates HTTP request
    > 3 App receives HTTP request
    > 4 App generates HTML dynamically
    > 5 App sends HTTP response
    > 6 App receives HTTP response
    > 7 App displayes generated HTML in Swing widget
    >
    > My scenario
    >
    > 1 App user clicks on link
    > 4 App generates HTML dynamically
    > 7 App displayes generated HTML in Swing widget
    >
    > --
    > RGB


    What do you mean? Is it possible to generate dynamic HTML and read it
    on an application without any web server and browser?
    If yes, it could be a good solution, if you can generate dynamically
    even a complex web site.
    Please tell more about this solution


    Thanx
    Carmelo
     
    carmelo, Jul 22, 2008
    #6
  7. carmelo wrote:
    > On 22 Lug, 10:57, RedGrittyBrick <> wrote:
    >> Abhijat Vatsyayan wrote:
    >>
    >> No you wouldn't.
    >>
    >> Your scenario
    >>
    >> 1 App user clicks on link
    >> 2 App creates HTTP request
    >> 3 App receives HTTP request
    >> 4 App generates HTML dynamically
    >> 5 App sends HTTP response
    >> 6 App receives HTTP response
    >> 7 App displayes generated HTML in Swing widget
    >>
    >> My scenario
    >>
    >> 1 App user clicks on link
    >> 4 App generates HTML dynamically
    >> 7 App displayes generated HTML in Swing widget
    >>
    >> --
    >> RGB

    >
    > What do you mean? Is it possible to generate dynamic HTML and read it
    > on an application without any web server and browser?


    Yes.
    * Some Swing components can "render" HTML
    * Using Java you can create HTML
    This should hardly be a surprise!


    > If yes, it could be a good solution,


    The HTML support in Swing is rather old. If you are expecting Javascript
    and CSS you are out of luck.


    > if you can generate dynamically even a complex web site.


    The OP mentioned "Eclipse help" - I am talking about something that is
    usable for "help" within a Java desktop application.

    I am not talking about a "site" in the sense of some Internet/Intranet
    facing HTTP service.


    > Please tell more about this solution


    For example:

    Write some class that generates some HTML dynamically.
    Use a JEditorPane in your view (e.g. pop-up window).
    Use the setEditable(false) method of the pane.
    Add a HyperLinkListener to it.
    In that listener,
    use event.getUrl() to find what link was clicked.
    call the HTML generating class
    put the generated HTML into the JEditorPane
    setPage() or setText() ...


    --
    RGB
     
    RedGrittyBrick, Jul 22, 2008
    #7
  8. RedGrittyBrick wrote:

    > For example:
    >
    > Write some class that generates some HTML dynamically.
    > Use a JEditorPane in your view (e.g. pop-up window).
    > Use the setEditable(false) method of the pane.
    > Add a HyperLinkListener to it.
    > In that listener,
    > use event.getUrl() to find what link was clicked.
    > call the HTML generating class
    > put the generated HTML into the JEditorPane
    > setPage() or setText() ...
    >
    >


    See
    http://www.softcoded.com/web_design/java_help_files.php

    I have used this within a Java desktop app to show hyper-linked help
    pages to the user. I stored the static HTML pages in the application
    Jar. However it should be obvious how to extend this example to use
    dynamically generated HTML.

    No HTTP server needed.

    --
    RGB
     
    RedGrittyBrick, Jul 22, 2008
    #8
  9. carmelo

    carmelo Guest

    On 21 Lug, 21:30, Mark Space <> wrote:
    > carmelo wrote:
    > > Hi there,
    > > I need to make an application with an internal browser and an internal
    > > web server. Do you know anything that can help for this purpose?
    > > When you open the Eclipse help, you can see that it uses an internal
    > > browser and an internal http server... I need something similar...
    > > What do you suggest to start?

    >
    > > Thank you very much in advance
    > > Carmelo


    > Can Eclipse be used as a platform like NetBeans can? I'd look into
    > that.

    What do you mean?

    > If Eclipse has a working browser and server that does what you
    > want, you may be able to use those components directly.

    It has a working browser, and I suppose a working http server because
    when you use its Help you can see that it refers to http://127.0.0.1:49473/help/
    I don't know if it's simply an http server, or if it's a web server...
     
    carmelo, Jul 23, 2008
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Bonds
    Replies:
    2
    Views:
    2,738
    Amaryllis
    Aug 3, 2004
  2. =?Utf-8?B?RGFubnk=?=
    Replies:
    1
    Views:
    1,114
    Joerg Jooss
    Dec 3, 2005
  3. Replies:
    5
    Views:
    80,157
    cpdarkman
    Aug 26, 2009
  4. JM
    Replies:
    0
    Views:
    4,075
  5. c676228
    Replies:
    6
    Views:
    160
    Steven Cheng[MSFT]
    Feb 14, 2007
Loading...

Share This Page