• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HTML form submission

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hii java gurus,

Iam dislaying a html file in JEditorPane using HTMLEditorkit.It works fine.
If i submit a html form,how will my program know about the form parameters that will be submitted?
What action listeners do i need to implement ? After searching much i have found HTMLDocument.HTMLReader.FormAction in javax.swing.text.html package.
but it is very confusing. can anybody please explain me in simple steps ?



Thanks
 
Vinod Awar
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
any thoughts on this?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you submit a form, then a URL is involved (to which the form is submitted). That's where you need to install a servlet or some other kind of active server code that collects the parameters.

The Swing client just displays the HTML pages - it is a browser, not a web server.
 
Vinod Awar
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
does it trigger HyperLinkEvent ? how can i access the values submitted?
i want to submit the form back to my program not to any other server.

Thanks
[ May 22, 2007: Message edited by: vinod awar ]
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A link is not a form submit, and a browser is not a server.

If you want to run a web server as part of a desktop app, then you can easily use Tomcat to do that; this article explains how.
 
Vinod Awar
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ulf, i found solution.Now i can access the submitted values. on clicking the submit button it triggers FormSubmitEvent.FormSubmitEvent is a subclass of HyperlinkEvent. Using FormSubmitEvent's getData() method one can access the form parameters. here is my code




[ May 22, 2007: Message edited by: vinod awar ]
[ May 22, 2007: Message edited by: vinod awar ]
 
I am displeased. You are no longer allowed to read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic