Hi,
I have got the values by passing the query string in an iframe.src = "xyxz.jsp?name="+name+"&pass="+pass+"&id="+id
.
I need to pass those values which i have got to another jsp page
<iframe src="xyz.jsp"></iframe>
How can i do that?
Hi,
I have got the values by passing the query string in an iframe.src = "xyxz.jsp?name="+name+"&pass="+pass+"&id="+id
.
I need to pass those values which i have got to another jsp page
<iframe src="xyz.jsp"></iframe>
How can i do that?
Use Javascript to dynamically change the src attribute of frame
function changeSrc()
{
window.frames['testframe'].src = "xyxz.jsp?name="+name+"&pass="+pass+"&id="+id;
}
Is this what are you looking for?
according to your cooment to @Manjoor post you want to call javascript function which is defined inside iframe and pass the parameters to it, if that so check this post
http://stackoverflow.com/questions/251420/invoking-javascript-in-iframe-from-parent-page
Your question is unclear, but I guess that you want to pass the querystring of the parent JSP page to the JSP page which is in an iframe
of the parent JSP page. If so, then just print HttpServletRequest#getQueryString()
:
<iframe src="page.jsp?${pageContext.request.queryString}"></iframe>
That said, iframes are an extremely bad practice and very clumsy when all the pages are located at the same server. Rather use server side includes using <jsp:include>
. This way the included JSP has access to the same request object.