Internal web server and browser

C

carmelo

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
 
R

RedGrittyBrick

carmelo said:
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.
 
M

Mark Space

carmelo said:
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.
 
R

RedGrittyBrick

Abhijat said:
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
 
C

carmelo

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

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
 
R

RedGrittyBrick

carmelo said:
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() ...
 
R

RedGrittyBrick

RedGrittyBrick said:
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.
 
C

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...
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top