• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Desktop application accessing HTTP access and handling cookie information?

 
S Chan
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21113
32
Eclipse IDE Firefox Browser MySQL Database
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 295
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
S Chan
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic