Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iframe query string

Tags:

javascript

jsp

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?

like image 496
Lalchand Avatar asked Nov 06 '22 11:11

Lalchand


1 Answers

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.

like image 50
BalusC Avatar answered Nov 12 '22 17:11

BalusC