I have servlet that redirect user to a page with frames. How can I redirect to the page by putting its target="parent" to avoid the situation of frame within a frame. Now i redirect as below:
You can't. Once a request has been submitted to a particular window/frame there is no way to cause its response to be delivered to another.
You either need to submit the original request to the desired frame, or use some Javascript magic on the client side to control loading into frame (in other words, your response can write Javascript to the client that can cause the desired frame behavior).