Example of a Bad JSP

				
<html>
<head><title>Bad JSP</title><head>
<body>
<%String[][] tableData={{"header-row1, col1", "header-row1, col2", "header-row1, col3"},
					{"row2, col1", "row2, col2", "row2, col3"},
					{"row3, col1", "row3, col2", "row3, col3"}
				   };%>	
<table>	
  <%for(int i=0;i<tableData.length;i++){%>
	<tr>
	  <%for(int j=0;j<tableData[i].length; j++){%>
		<%=((i==0)?"<th>":"<td>")%><b><%=tableData[i][j]%></b><%=((i==0)?"</th>":"</td>")%>
	<%}%>
	</tr>
  <%}%>
</body>
</html>

			
  • Mixing of markup and java code
  • Hard to update java code
  • Hard to update markup