Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: Conditionally Including files


Message #1 by "Mike Curwen" <mikec@q...> on Tue, 15 May 2001 14:21:51 -0500
Hi,

This is probably a very easy thing to do, but right now I am lost in the
forest, and the trees are getting in the way!

How can I conditionally include jsp content, based on received parameters.
Based on the format someone chooses, I want to populate the left side of the
table with one of four different jsp pages.  (One for each kind of format).
For example, this is what I really want to do.

<%
  String format = request.getParameter("format");
%>

<html>
	<head>
		<title>Video Player</title>
	</head>

	<body>
		<table border="1">
			<tr>
				<td><% if (format.equals("WinHi"))
				          <jsp:include page="uiWinHi.jsp" flush="true" />
				       else if (format.equals("WinLo"))
				       	   <jsp:include page="uiWinLo.jsp" flush="true" />
				       else
				           <jsp:include page="uiBlank.jsp" flush="true" />
				     %>

				</td>
				<td><jsp:include page="uiSelectFormat.jsp" flush="true" /></td>
			</tr>
		</table>
	</body>
</html>
This obviously won't work, but can someone show me what will?

Thanks,


Mike C.


  Return to Index