Not sure what you mean by "refresh", but not executing parts of a page can be done with JSTL's if and choose statements.
posted 2 weeks ago
i am sorry i did not deliver my question in a proper way. what i actually meant was...I want a specific part of my code in a jsp page to be executed based on a given time automatically. Like the refresh option in the jsp page..but the refresh option refreshes the whole page but i just want a prt of the code in the page to be executed or refreshed every 2 or 3 secs..
JSP is a server side technology, which means that if you want to refresh the page you will have to perform a request to the server which will return the new page. It is not possible to just return part of a page through normal JSP mechanisms.
i think ajax is easy for refresh part of the code.
I think probably that you are using the word "code" wrong.
JSPs are primarily HTML templates designed to present a View to a client. There should not be a lot of executable code in the JSP. That's an obsolete and very hard-to-debug practice. Instead, the JSP should primarily be markdown language (HTML).
However, a popular thing to do these days is to do a partial page update for a client, where instead of replacing the currently-displayed page image (HTML) with a whole new one, you keep the majority of the currently-displayed client-side page and simply update parts of it. And you do that using AJAX.
That's my best guess on what you really want. If you can describe an abstract example of what you are expecting to see happen from the client viewpoint, we can probably offer more specific details.
"privilege" comes from the Latin words for "private" and "law" (legal) and dates to feudal times. To "claim privilege" meant that you were above the laws that applied to the common people.
She'll be back. I'm just gonna wait here. With this tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book