Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-18-2009, 07:39 AM
Member
 
Join Date: Apr 2009
Posts: 5
Rep Power: 0
UCSDinside is on a distinguished road
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!!!
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 04-18-2009, 07:47 AM
OrangeDog's Avatar
Senior Member
 
Join Date: Jan 2009
Location: Cambridge, UK
Posts: 838
Rep Power: 2
OrangeDog is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 04-18-2009, 08:03 AM
Member
 
Join Date: Apr 2009
Posts: 5
Rep Power: 0
UCSDinside is on a distinguished road
Default
Hmmm, everything I find on it is related to javascript. Do these apply for a java application as well?
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 04-18-2009, 08:16 AM
Member
 
Join Date: Apr 2009
Posts: 5
Rep Power: 0
UCSDinside is on a distinguished road
Default
Okay, I found this in the DocumentBuilderFactory API:

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?
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 04-18-2009, 08:37 AM
OrangeDog's Avatar
Senior Member
 
Join Date: Jan 2009
Location: Cambridge, UK
Posts: 838
Rep Power: 2
OrangeDog is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 04-18-2009, 10:13 AM
Member
 
Join Date: Apr 2009
Posts: 5
Rep Power: 0
UCSDinside is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 04-18-2009, 05:31 PM
OrangeDog's Avatar
Senior Member
 
Join Date: Jan 2009
Location: Cambridge, UK
Posts: 838
Rep Power: 2
OrangeDog is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 04-18-2009, 08:19 PM
Member
 
Join Date: Apr 2009
Posts: 5
Rep Power: 0
UCSDinside is on a distinguished road
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!
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 04-18-2009, 09:18 PM
OrangeDog's Avatar
Senior Member
 
Join Date: Jan 2009
Location: Cambridge, UK
Posts: 838
Rep Power: 2
OrangeDog is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT +2. The time now is 06:12 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org