Apr 16, 2012

How to update elements without refreshing the page

Hi Guys, If you want to update page elements dynamically without refreshing a page check this out :
Sorry for making it as images as it was looking too messy if displayed as normal text unlike in eclipse :-)






// in java simply get the request parameter and process it and send it via response
if(!request.getParameter("myVariable").equals("")){
save/ process your data
response.setContentType("text/html;charset=UTF-8");
response.getWriter().write("myUpdatedvalue :"+theUpdatedValue);
}

all you have to do is create a request object and use appropriate get or post and get the response.
Read more »