File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Refreshing only part of the screen in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Refreshing only part of the screen in jsp" Watch "Refreshing only part of the screen in jsp" New topic

Refreshing only part of the screen in jsp

Sunitha Mudidani

Joined: Apr 25, 2006
Posts: 28
I am working on an app which has the following requirements

The info on the page is divided into sections and display only. To update the info on the sections we will have popup windows and when saved, only this section on the main page gets refreshed. But in few cases more than one section needs to be refreshed.

1) Using Ajax allows to refresh only that section? Shd each section be implemented as frames ? I have no idea on ajax.

2) Is it possible to refresh more than one section(not the entire page) based on the changes in one section?

3) The app uses struts framework. Pls point to the relevant examples and resources.

Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
There are a few choices. Without AJAX, you can use JavaScript to set the location attribute of an IFrame, or two or three of them. That will issue a GET request to the server.

With AJAX, your JavaScript makes an invisible asynchronous call to the server and when the response comes back your script modifies the HTML DOM in the browser and the changes appear without refreshing the whole page. It's pretty magical, but not simple. See if the Prototype library Introduction to AJAX gives you enough info to decide if you want to pursue it.

Let us know what you think.

This discussion probably ought to move to an HTML forum or something.

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
An alternative to AJAX would be a frame/iframe-based approach.
Sunitha Mudidani

Joined: Apr 25, 2006
Posts: 28
Thanks for the replies.. had gone through ajax (an overview).. not sure how complex it will be to implement unless i try to run some examples. I need to try the frame approach as well. but can you point to some j2ee examples using any of the above so that i can start right away.

Thanks a lot!!
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63843

Please take the time to choose the correct forum for your posts. This forum is for questions on Java.

This post has been moved to a more appropriate forum.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Refreshing only part of the screen in jsp
It's not a secret anymore!