Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Should I use servlets or AJAX?  RSS feed

 
Darko Markovic
Greenhorn
Posts: 16
C++ Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In short, I want to make a JSP with a combobox and a button. When I click the button, it should read the combobox, find the tag that has that name in an xml file, read the link that's between the tags and connect to an SQL database by using the link. I've already managed to do this in a desktop application, so I know what commands I should use. The problem is, I can't write the code in JSP because a button click is client-side. Should I use a servlet or AJAX, and how should I use them? Or am I just oblivious to another obvious and simpler answer?
 
Tim Holloway
Bartender
Posts: 18549
61
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"AJAX" is not a component. If you use AJAX, something has to contain the server-side code that supports it. That something is usually a servlet.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65898
135
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exactly; so it's not a matter of Servlets or Ajax, but of Servlets and Ajax.
 
Darko Markovic
Greenhorn
Posts: 16
C++ Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oooooooh. Thanks. *The more you know*
 
Darko Markovic
Greenhorn
Posts: 16
C++ Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I managed to do my program using basic jsp and a servlet. I must not know what AJAX is then, because I don't recall ever using it. AJAX is short for Asynchronous JavaScript And Xml, but I never used JavaScript. Thanks anyway guys!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!