This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma 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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet parsing data to javascript" Watch "servlet parsing data to javascript" New topic

servlet parsing data to javascript

Xenofon Vassilakopoulos

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 !

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

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


Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63870

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] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: servlet parsing data to javascript
jQuery in Action, 3rd edition