views:

449

answers:

1

I have a page with a link. On clicking the link a page opens up in a separate window. This new page has a form. On submitting this form, some operation takes place at the server. The result of which needs to be redirected to the same page. However after the operation on using the following:

return new ModelAndView("newUser");
//This view "newUser" actually maps to the popped up window.

A similar new window again pops up and the message gets displayed on this new page. Any ideas as to why this behavior or how to go about this?

A: 

If you open a popup window with a form in it, any submits from here to the server will be handled in the same location, so you will get your response (and any subsequent request-responses) in that popup window.

If I understand this right, you have a page X which opens the popup, you submit in the popup and as a result you want again the content of page X, but in the popup?

If that is the case I thing the behavior is not from Spring but from what you have in the X page. Maybe a JavaScript which gets triggered on load and opens a new popup? Can't really tell without seeing more code.

dpb
As you have mentioned, the flow is like this .I have a page X which opens a popup.I submit in the popup. I expect the result of the operation of the submission in the pop up, for that I redirect to the same pop up page, but the redirection gives another pop up with the result.I dont quite understand why this is so... :(
ria
Do you by any chance have a target="_blank" on the form in the popup? Do you use JavaScript in your pages and somehow interact with the form submission or result? I can't tell from just the behavior.
dpb
Thanks.. It was an old code.. and I just checked to find one.. :)
ria