This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi I am displaying certain information to user (say showContent.jsp) which is pop up window. In this page showContent.jsp the user has the option to download the content and close the window, using download and close button. Based on the button clicked, i call either window.close or window.submit.
But the problem is whenever i click the close button and tried to close the window using window.close(), the page is get submitted to the previous request. i.e Say from a parent window through link i am requesting for ShowContent(/showContent is the request path which i handled in Action mapping and pass the request to this showContent.jsp). Then showContent.jsp is displayed to the user in a pop-up. And when i clicked close button, the window is closed but from the log file, i found out that again a request for /showContent is triggered. but the UI is fine.
i pasted all the code that are involved in this process..
1- Remove the onsubmit event from your form. 2- Change your first button to: <html:button property="method" onklick="closeWindow()"> <bean:message key="button.close"/> </html:button>