This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Servlets and the fly likes servlet parsing data to javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet parsing data to javascript" Watch "servlet parsing data to javascript" New topic
Author

servlet parsing data to javascript

Xenofon Vassilakopoulos
Greenhorn

Joined: Dec 20, 2010
Posts: 1
Hi !!

i have a problem with my java web application in netbeans. Im using Ajax to parse attributes to a servlet from my jsp page and to get back data in XML format to the javascript .
the XML attributes that i want to get back is actually a message that confirms the succesfull insertion of the form data in my data base.the message is used to popup an alarm box in my javascript and to inform the user of the succesfull or not succesfull insertion .
The problem is that im getting the wrong message despite the fact that the insertion was being succesfull!!! the strange thing is that when im running the code in debug mode through firebug everything work great and the right message appears!!
i was considering the fact that the problem is happening because the readyState is not changing the state from 1 to 4 very quickly to let the servlet to be executed first , but unfortunately im wrong !


[ InsertPayeeElements.java : SQLcommand is actually the string that keeps the message that shows up after executing a query on j850_insertPayee.java

the message is either "entered" or "not entered" ]

is there anybody that can help with this ?

this is ths Messages.js
------------------------------------------------------------------------------------------------------------------------------------------------------------------


---------------------------------------------------------------------------------------------------------------------------------------------------------------------
this is the code inside the InsertPayeeElements.java
---------------------------------------------------------------------------------------------------------------------------------------------------------------------


-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61458
    
  67

Please be sure to use code tags when posting code to the forums. Unformatted or unindented code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please click this link ⇒ UseCodeTags ⇐ for more information.

Properly indented and formatted code greatly increases the probability that your question will get quicker, better answers.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: servlet parsing data to javascript