• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Should I use servlets or AJAX?

 
Greenhorn
Posts: 16
Netbeans IDE C++ Java
  • 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?
 
Bartender
Posts: 20828
125
Android Eclipse IDE Tomcat Server Redhat Java 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.
 
Sheriff
Posts: 67265
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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
Netbeans IDE C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oooooooh. Thanks. *The more you know*
 
Darko Markovic
Greenhorn
Posts: 16
Netbeans IDE C++ Java
  • 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!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!