Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Running a dynamic database query and updating the page without refresh.  RSS feed

 
Tobius Perry
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

So i have developed a jsp application with an MVC architecture, and I want to update a part of my page, based on a query made to my database. Where the query itself is dependent on a value selected into the page, for example:
I select a person from a dropdown, and their favorite biscuit is displayed without submitting the page.

I'm familiar with Jquery, Javabeans and JSTL, I don't need any code, but I'm trying to work out the process.

Fairly new to JSP so sorry if I'm overlooking something really obvious.
But would really appreciate any help that can be provided, thanks in advance.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65830
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP doesn't have much to do with this. JSP runs on the server to create the HTML page to display on the browser. Once the response leaves the server, the JSP is done and gone.

You'll need to use jQuery on the client to make an Ajax call (which can, in turn, use JSP to format the response).

If what runs where and why is confusing, you might find this article helpful.
 
Tobius Perry
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear, that definately helped a lot.

I didn't convey it in my post, but I was also particularly confused with what happens server side, so if anyone is particularly confused about interaction with databases, the following guide helped:

http://www.daniweb.com/web-development/jsp/threads/141776/jsp-database-connectivity-according-to-model-view-controller-mvc-model-2
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!