Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

"browser integration" in a desktop app

Thread view: 
sponxe@gmail.com - 23 Nov 2006 11:17 GMT
I developed a C# desktop app with an integrated webbrowser control
because often I need to auto-fill some fields in a remote php form.

Now I would like to move to Java (rewriting the app) because I am
planning to abandon completely Windows but I have a problem with the
aforementioned feature. Does Java have something like that (maybe in
6.0) to allow me to integrate one browser (I assume Firefox on Linux)
so that I can get the webpage form, extract the fields and fill them?

Thanks in advance.

sponxe

P.S. I tried Mono on Linux but my app doesn't work and besides I
already planned to rewrite a lot of classes (time is not a problem).
Andrew Thompson - 23 Nov 2006 12:25 GMT
...
> ..Does Java have something like that (maybe in
> 6.0) to allow me to integrate one browser (I assume Firefox on Linux)
> so that I can get the webpage form, extract the fields and fill them?

JDIC seems to have a project(/API) that does this,
under 'demos' is a 'browser'..
<https://jdic.dev.java.net/#demos>

Some further docs. here.
<https://jdic.dev.java.net/nonav/documentation/javadoc/0.9/org/jdesktop/jdic/brow
ser/WebBrowser.html
>

( I have no further information on it, beyond seeing
the JWS demo it on-screen - which seems to wrap
an IE window in Java controls, here. )

Andrew T.
Oliver Wong - 23 Nov 2006 17:36 GMT
>I developed a C# desktop app with an integrated webbrowser control
> because often I need to auto-fill some fields in a remote php form.
[quoted text clipped - 11 lines]
> P.S. I tried Mono on Linux but my app doesn't work and besides I
> already planned to rewrite a lot of classes (time is not a problem).

   If you actually want to display the HTML form as a GUI element to the
user, then you'll have to use a third party library, or Sun's Editor Pane
(http://java.sun.com/docs/books/tutorial/uiswing/components/editorpane.html)
Bewarned though that the Editor Pane doesn't handle HTML very well, and
hasn't been updated since the HTML3.2 days, I think.

   If you don't need to actually display the HTML form, but just auto-fill
and submit form, best bet is to just send an HTTP request with the
appropriate GET or POST headers directly.

   - Oliver
sponxe - 23 Nov 2006 18:24 GMT
Thanks for the replies.

In effect I just need to auto-fill and submit the form so I think I am
going to use the "GET or POST" solution.

The only problem is that I never worked directly with HTTP requests so
any suggestion (links or tutorials) is greatly appreciated...

Thanks again.

sponxe
sponxe - 23 Nov 2006 18:30 GMT
Ah just in case I change my mind in the future do you have suggestion
for a third party library that I could get?  

Thanks

sponxe
Oliver Wong - 23 Nov 2006 18:51 GMT
> Thanks for the replies.
>
[quoted text clipped - 3 lines]
> The only problem is that I never worked directly with HTTP requests so
> any suggestion (links or tutorials) is greatly appreciated...

   If you don't already know socket programming, read
http://java.sun.com/docs/books/tutorial/networking/index.html

   Once you know socket programming, you just need to learn the HTTP
protocol. The specifications for it are called "RFCs" (Request For
Comments), so google for "HTTP RFC" to find the RFCs (there are several)
that are relevant to HTTP. However, personally, I find it difficult to learn
protocols reading only the RFCs, so you might have better luck using a
packet-sniffer and intercept the packets that a "real" webbrowser (like IE
or FireFox) send out, and just reverse engineering what's going on.

   - Oliver
smbear - 24 Nov 2006 10:04 GMT
>> Thanks for the replies.
>>
[quoted text clipped - 14 lines]
> packet-sniffer and intercept the packets that a "real" webbrowser (like IE
> or FireFox) send out, and just reverse engineering what's going on.

I've had similar problem. Everything I used is BufferedReader,
InputStreamReader, URL for downloading HTML pages plus URLEncoder for
posting form entries. It seems to be good enough for HTTP GET method. I
didn't need to learn HTTP protocol.

Tomek Duda
mailfootball@gmail.com - 25 Nov 2006 11:35 GMT
Thanks for all the replies.

I will settle for the GET and POST approach to the problem and now I
have all the information to perform the op and (before that) learn more
on the subject.

Thanks again!

sponxe
sponxe - 25 Nov 2006 13:50 GMT
Thanks for all the replies.

I will settle for the GET and POST approach to the problem and now I
have all the information to perform the op and (before that) learn more
on the subject.

Thanks again!

sponxe


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.