<%-- This page won't actually work, as it is simply designed to display jsp syntax highlighting. --%> <%@ page info="A Page to Test Kate Jsp Syntax Highlighting" language="java" errorPage="/test-error-page.jsp"%> <%@ include file="/include/myglobalvars.jsp"%> --%> <%@ page import="java.util.*, java.io.*, java.math.*"%> <%@ taglib uri="/WEB-INF/lib/si_taglib.tld" prefix="si"%> id="aPageBean" scope="page" class="my.package.MyPageBean"/> id="aRequestBean" scope="request" class="my.package.MyRequestBean"/> <% // We can decipher our expected parameters here. String parm1 =noNull(request.getParameter(PARAMETER_1)).trim(); String parm2 =noNull(request.getParameter(PARAMETER_2)).trim(); String parm3 =noNull(request.getParameter(PARAMETER_3)).trim(); String parm4 =noNull(request.getParameter(PARAMETER_4)).trim(); String parm5 =noNull(request.getParameter(PARAMETER_5)).trim(); // A sample collection of Integers to display some code folding. List intList =getIntList(10); %> A Sample Jsp <%-- The top label table. --%>
<%! /* A place for class variables and functions... */ // Define some sample parameter names that this page might understand. privatestaticfinalString PARAMETER_1 ="p1"; privatestaticfinalString PARAMETER_2 ="p2"; privatestaticfinalString PARAMETER_3 ="p3"; privatestaticfinalString PARAMETER_4 ="p4"; privatestaticfinalString PARAMETER_5 ="p5"; // Returns str trimmed, or an empty string if str is null. privatestaticStringnoNull(String str){ String retStr; if(str ==null) retStr =""; else retStr = str.trim(); return retStr; } // Returns a list of Integers with listSize elements. privatestaticListgetIntList(int listSize){ ArrayList retList =newArrayList(listSize); for(int i =0; i < listSize; i++) retList.add(newInteger((int)(Math.random()*100))); return retList; } %>