user2049701
user2049701

Reputation: 1

how to close frames created in jsp when log out and forward to the index page

i have three frames top,left and right & top frame contains log-out option but when click on log-out the index page is displays on top frame i want to close all frames and forward to index page using jsp servlet

Upvotes: 0

Views: 498

Answers (1)

Himani Kothari
Himani Kothari

Reputation: 113

Instead of submitting form from within your frame, you can have a hidden form in your parent page. OnClick of submit button from the frame pass all the required request parameters and call the function from parent page to submit the hidden form.

Use

window.parent.document.getElementById(<id of hidden form in parent window>).submit();

The values of input fields in the hidden form can be set in the same way.

On the contrary if form is the only thing you have in your frame you can avoid the frame itself or if you are using an external HTML/JSP you can also use the include tag to include the external JSP in your page.

Upvotes: 1

Related Questions