<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title> Programming Talk - JSP include based on parameter </title> </head> <body style="background:white"> <% String articleID = null; if( (articleID = request.getParameter( "articleID" ) ) != null ) { %> <jsp:include page='<%= articleID + ".jsp" %>' /> <% } else { %> <form method="get" action="docServer.jsp"> <!-- change this to the name of your JSP --> <table> <tr><td>File to include: <input type="text" name="articleID" size="10" /></td></tr> <tr><td align="center"><input type="submit" value=" Submit It " /></td></tr> </form> <% } %> </body> </html>