• Post Reply Bookmark Topic Watch Topic
  • New Topic

handling Http POST methods with a HyperlinkListener (Swing)  RSS feed

 
Biddie Mulligan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to write a program tha uses a JEditorPane to display HTML Pages and handles Hyperlinks from the pages. I can find lots of example of using HyperlinkListeners to navigate form page to page, but I cant figure out how to handle submitting a form (HTTP POST method) using HyperlinkListener. Is this possible, or do I need more that Swing components and classes to do it?
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to this post on Expert's Exchange you should be able to do a POST action in your forms... and it gives some code to do it.

I haven't tried this personally though.
 
Biddie Mulligan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for this comment Nathan , but this posting doesn't really address the issue.
I have a JEditorPane that will be loaded with a HTML form. The form contains a submit button. I want to be able to trap and handle an event when the user presses the form's submit button (In a similar way to the way I can trap and handle a HyperLinkEvent). What I need to do is to create a URLConnection , set up header's, cookies and parameters etc, and generate a Http request POST request to a server - just like any web browser would do.
Any ideas/suggestions, reference books etc..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!