I have a Page (Shopping Cart), in that page there is box showing cart items and prices. And also the same page contains one link which is pointing to completely different site(different context).
When the user clicks on that link, one popup window opens and going to that site. Once the user fills the form and submits, it goes to DB and updates the record and finally after we get the confirmation page on the popup, there is a close button on the popup which indicates to close that page.
Generally once we close the popup window it supposed to update the cart items and price, but it doesn't. When we refresh the page, the items are grabing from DB and displaying updated data.
Suppose if the popup window is with in the application, then we can refresh the page easily, but in this case its bit difficult to update page since pop is different site.
I know we need to place this line popup window's javascript, but here the popup window is a different context which we can't access to handle the jsp pages.
So how we can refresh the main page with that line?
Web app contexts are moot. If there is a client-side relationship between the windows, Eric's approach will work. If there is not a relationship, there is nothing you can do.
If you do not have control over the code in the external window (like opening a external site in the popup), then you can poll for the status of the popup window and do a self refresh when the popup window is closed.
From main window start a polling routine using setTimeout when the popup is opened, that checks for the popup window's state. If the popup window handle is closed or null then clear the timeout and perform the refresh.