Reputation: 1393
I am working on combination of jsp and servlets. I have to reload a specific part of jsp page ( maybe table, div or section ) when servlet updates the value in db, without refreshing the entire page.
I am not a pro jQuery user, but can understand it as beginner.
Upvotes: 2
Views: 8065
Reputation: 1974
Give your table, div or section an id (aaa in example) and try this:
<script src="http://code.jquery.com/jquery-latest.js"></script>
<button onclick="jQuery('#aaa').load(' #aaa');">Reload</button>
<div id="aaa"><%=new java.util.Date().toString()%></div>
Upvotes: 6
Reputation: 3263
You can use Ajax
, which browser will support default as simple too.
You can also use DWR(Direct Web Remoting)
, but it require to add some additional configuration in web.xml and add jar.
Upvotes: 1