This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
Author

Refreshing only part of the screen in jsp

Sunitha Mudidani
Greenhorn

Joined: Apr 25, 2006
Posts: 28
Hi,
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.

Thanks
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
Marshal

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


Ping & DNS - my free Android networking tools app
Sunitha Mudidani
Greenhorn

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
Marshal

Joined: Jan 10, 2002
Posts: 60766
    
  65

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] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Refreshing only part of the screen in jsp
 
Similar Threads
How to refresh page only once automatically when page is loaded
Ajax with JSF
View Refresh after form closed
Error handling JSF Form Divisions
ArrayI ndex OutOfBoundsException when page refresh