In my app I presently have several classes that make connections and pull various other data.
All of that has nothing to do with Ajax. Once the request has been submitted to a server-side resource, that can do whatever it needs to access the database. What are you using for server-side code? Servlets? php?
Since I am a little familar with java servlets and I know how to use them to create java objects and I already have java objects that make necessary connections, can I just use AJAX to call a servlet which can create a session attribute and then use the attribute on my calling form. I really apologize for my lack of understanding. Every day I learn more thanks again.
Originally posted by Steve Dyke: can I just use AJAX to call a servlet which can create a session attribute and then use the attribute on my calling form.
Well, sort of. Sure, you can call the servlet via AJAX. (Actually what you really do is to send a request for the servlet.) And sure, that servlet can put attributes into the session and get attributes from the session. Servlets can do that. But servlets return text to your browser. HTML, most likely. Or perhaps XML or some other format, but whatever you want to return, you have to format as text. Normally that isn't a problem at all.
posted 13 years ago
Can someone give me syntax example for posting to servlet from AJAX?