I not sure if i can use parent.framename.location.href= ...... as this is in a servlet. Usually i move back to the same frame by using. redirectToURL(res,"name_of_file.jsp", uniqueId); How can i use the target attribute in the servlet.
posted 17 years ago
this is what I am guessing they were actually talking about <a href="<% blah %>" target="framename">Your link</a> I will get others here to give you a better answer....
How can i use the target attribute in the servlet.
You can't. Once a request has been sent to a particular window (and that includes frames and iframes), the response must be sent back to that same window. If you want the response to go into a different frame than its initiator, then you must use the target attribute on the client side to cause the request to be made into the desired window in the first place. bear [ October 10, 2003: Message edited by: Bear Bibeault ]
Ok fine i am in the process of checking out the info that you send.(Calling the servlet from the other frame by defining the function there).i called the servlet from the other frame by putting the called function in the other frame but i am not able to call it as the jsp cant find the function. This is what i did. ==================================================================== The main jsp <% String RightTopPan = "ReportsTop.jsp?uniqueId="+uniqueId; %> <% String RightBottomPan = "Reports.jsp?uniqueId="+uniqueId; %>
<HTML> <HEAD><TITLE>Main</TITLE></HEAD> <FRAMESET ROWS="50%,50%" border="0"> <frame name="RightTopFrame" src="<%=RightTopPan%>" marginwidth="10" marginheight="10" scrolling="auto" frameborder="0" target="RightTopFrame" > <frame name="RightBottomFrame" src="<%=EMCRightBottomPan%>" marginwidth="10" marginheight="10" scrolling="auto" frameborder="0" target="RightBottomFrame"> </FRAMESET> </HTML> ================================================================ The call to the servlet was from the ReportsTop.jsp but it should return from the servlet to Reports.jsp so i defined the function in Reports.jsp and called from ReportsTop.jsp as: <table> <tr> <select size="1" name="D1" id = "report" name="report" onChange="top.RightBottomFrame.doGetid()"> <option ></option> <option value="top20list" >Top 20 List</option> </select> </tr> </table> doGetid() function is in the Reports.jsp top.RightBottomFrame.doGetid() doesnt seem to work.