Results 1 to 9 of 9
  1. #1
    UCSDinside is offline Member
    Join Date
    Apr 2009
    Posts
    5
    Rep Power
    0

    Default How to get Form Data into my java class

    Hello, I am writing a script that is gong to send some form data in XML/SOAP envelope and am wondering how I can get my form data values into my class variables Any tips would be greatly appreciated!!!

  2. #2
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    The SAX or DOM APIs in javax.xml, org.xml.sax and org.w3c.dom
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

  3. #3
    UCSDinside is offline Member
    Join Date
    Apr 2009
    Posts
    5
    Rep Power
    0

    Default

    Hmmm, everything I find on it is related to javascript. Do these apply for a java application as well?

  4. #4
    UCSDinside is offline Member
    Join Date
    Apr 2009
    Posts
    5
    Rep Power
    0

    Default

    Okay, I found this in the DocumentBuilderFactory API:

    Java Code:
    public abstract Object getAttribute(String name)
                                 throws IllegalArgumentException{}
    Would a new object have to be created for each value of the form in javascript? How does it know to point to my java class file?

  5. #5
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    Sorry, I assumed you meant that you were sending the form data to a remote server, which you were writing in Java. I've never used JSP myself.
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

  6. #6
    UCSDinside is offline Member
    Join Date
    Apr 2009
    Posts
    5
    Rep Power
    0

    Default

    That is exactly what I am trying to accomplish in java. I need to send form data to a remote server in a SOAP envelope. I have the soap envelope all setup but I need to figure out how to get the form values from the HTML into my java.

  7. #7
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    You want some javascript that is called when you submit the form. You get the values in the form with stuff like Document.getElementByID("name").getValue(), which you then pass to whatever sends the SOAP message.
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

  8. #8
    UCSDinside is offline Member
    Join Date
    Apr 2009
    Posts
    5
    Rep Power
    0

    Default

    Great, and how do the values get passed from those javascript calls to my java code that sends the SOAP message? Thank you so much for the help BTW!

  9. #9
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    I'm afraid I don't know, never having used Java servlets.
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

Similar Threads

  1. how to capture jsf form data
    By Srikala in forum JavaServer Faces (JSF)
    Replies: 2
    Last Post: 07-16-2009, 09:06 AM
  2. how can i insert data form GUI to ...
    By the swan in forum AWT / Swing
    Replies: 3
    Last Post: 04-14-2009, 06:14 PM
  3. enctype=multipart/form-data with form data in struts
    By vk_satheesh in forum New To Java
    Replies: 0
    Last Post: 09-19-2008, 12:48 PM
  4. Inserting data to database from the form
    By Ms.Ranjan in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 06-17-2008, 01:06 AM
  5. how to upload a file along with html form data
    By pranith in forum Java Servlet
    Replies: 3
    Last Post: 07-30-2007, 02:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •