Java examples for Servlet JSP:JSP
Implementing Conditional Content on a JSP Page
<% if ("someValue".equals(request.getParameter("param1"))) { %> Generate this template text if param1 equals someValue <% } else { %> Otherwise generate this template text <% } %> <% switch (Integer.parseInt(request.getParameter("param2"))) { case 0: %> Generate this template text if param2 equals 0 <% break; case 1: %> Generate this template text if param2 equals 1 <% break; default: %> Generate this template text if param2 equals anything else <% } %>