aspose file tools*
The moose likes Beginning Java and the fly likes Desktop application accessing HTTP access and handling cookie information? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Desktop application accessing HTTP access and handling cookie information?" Watch "Desktop application accessing HTTP access and handling cookie information?" New topic
Author

Desktop application accessing HTTP access and handling cookie information?

S Chan
Ranch Hand

Joined: Jul 25, 2011
Posts: 51
Hi all,

This question may seem rather unusual for many experienced Java programmers, and I am not sure which forum this question fits best.
We have a custom-made CMS(content management system) which is based on PHP/MySQL and its front end is built with HTML/JavaScript. The CMS handles a lot of file-uploading and downloading between our web server and the remote clients.

We are a little frustrated for the limitation the html's ability in handling file uploads. To put it simply, it's too basic for us who want to do something more complicated. So, my manager was wondering how about building a Java desktop application/Java Web Start app and has it run on remote client? We want to discard the html/Javascript front end of the CMS and have the Java desktop app to act like a browser so that the app makes HTTP requests to the web server.

We've managed to write something that can send a POST request using a URL, but we are not too sure how to handle http headers and cookies for authentication purposes.

Are there any codes or simple tutorial we can take a look at? Advices on other things related to the above case/workaround would be appreciated too. Thank you very much for help.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18907
    
    8

I have used Apache HttpClient for that sort of thing in the past. I'm pretty sure it handles all of those issues.
S Chan
Ranch Hand

Joined: Jul 25, 2011
Posts: 51
Paul Clapham wrote:I have used Apache HttpClient for that sort of thing in the past. I'm pretty sure it handles all of those issues.


Haven't heard of that before! :shock: :eek:

That's helpful. I will take a look on that. :thumbup: Thank you!
Javin Paul
Ranch Hand

Joined: Oct 15, 2010
Posts: 281

Thumbs up to Paul and Thanks to Apache, Apache has made really fantastic library on top of Java no matter what is the requirement there is a Apache library


http://javarevisited.blogspot.com - java classpath - Java67 - java hashmap - java logging tips java interview questions Java Enum Tutorial
S Chan
Ranch Hand

Joined: Jul 25, 2011
Posts: 51
Please allow me to extend the question a bit:

How about displaying HTMLs? If, say, I want have some sort of previewing mechanism that displays HTML and CSS, as well as running JavaScript.

I know Swing components do support some HTML tags, but I don't think they are powerful enough to display web pages as good as ordinary web browsers.

Is there a good library to use for this purpose this time?

P.S. I have heard of Selenium as a HTML test suite. That is able to start up a Firefox window from Java, but I was thinking if there is a way to display the HTML inside a Swing app?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Desktop application accessing HTTP access and handling cookie information?