tags:

views:

58

answers:

3

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?

A: 

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?

Manjoor
where to call that function>>> inside an iframe???
Lalchand
NO it is on main page. Can you clear your question a little?
Manjoor
A: 

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

Kronass
+1  A: 

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.

BalusC