views:

343

answers:

1

Hi,

Im basically a .net developer, I am now working on a java web project,

here i need to basically get values from the back end (say generating a random number) and update that random number every second on the front end, i want to use jquery for this,

in ASP.net, i know that I can have an updatepanel and use _doPostBack to update the panel without refreshing the whole page.

It might be a stupid question but im a java newbie.

Any help/examples of something that does the same would be greatly appreciated.

Thanks.

+1  A: 

In Java you would do something like this with JSF and a rendering kit like MyFaces or IceFaces. A .NET developer would need considerable time to learn these technologies.

If you are going to use both .NET and Java, I recommend to invest some time to learn jQuery and client programming really well. This knowledge can serve you in both worlds. It is a trivial task to implement UpdatePanel functionality with jQuery. Just create a service that returns the content and load it with $.load().

kgiannakakis
I am pretty smooth with jquery, when you said service, did you refer to a Java Webservice? how do I implement updatePanel in java using jquery? sorry but i am a bit lost here. Thanks for your help.
Mponnada
No, it doesn't have to be a web service. Just create a jsp page or a servlet that will return the content of the panel. Create a javascript timer in your main page to load the panel whenever is required. Or bind a jQuery event (click for example) to load it.
kgiannakakis
ok, thats sounds good, so would it be that I have a simple div (which) would be a panel and I get the servlet to return the content (anything) then use a timer to refresh the panel on an event? That sounds pretty neat..
Mponnada