I have a page where I include another page passed via url
Url is something like


and I get the variable as

String thePage = request.getParameter("page") ;

Now I want to include it in my page and the code below doesn't work. I have googled and I cannot understand why I cannot get relevant result. Please help

<jsp:include page=<%=thePage%> flush="true"></jsp:include>

First you missed the double quotes for page attribute. The line should be

<jsp:include page="<%=thePage%>" flush="true"></jsp:include>

Also you can only use relative urls for the page attribute.
As per the docs,
The relative URL looks like a pathname--it cannot contain a protocol name, port number, or domain name. The URL can be absolute or relative to the current JSP page. If it is absolute (beginning with a /), the pathname is resolved by your web or application server.

Hope this helps