From ce4a32fe52ef09d8f5ff1dd22c001110902b60a2 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kate/tests/highlight.jsp | 170 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 kate/tests/highlight.jsp (limited to 'kate/tests/highlight.jsp') diff --git a/kate/tests/highlight.jsp b/kate/tests/highlight.jsp new file mode 100644 index 000000000..d912836bd --- /dev/null +++ b/kate/tests/highlight.jsp @@ -0,0 +1,170 @@ +<%-- + 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"%> + + +<% + // 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. --%> + + + + +
The following parameters were detected:
+ + <%-- Display the parameters which might have been passed in. --%> + + <%-- Label; Actual Parameter String; Value Detected --%> + + + + + + + <%-- Label; Actual Parameter String; Value Detected --%> + + + + + + + <%-- Label; Actual Parameter String; Value Detected --%> + + + + + + + <%-- Label; Actual Parameter String; Value Detected --%> + + + + + + + <%-- Label; Actual Parameter String; Value Detected --%> + + + + + +
PARAMETER_1<%=PARAMETER_1%>"<%=parm1%>"
PARAMETER_2<%=PARAMETER_2%>"<%=parm2%>"
PARAMETER_3<%=PARAMETER_3%>"<%=parm3%>"
PARAMETER_4<%=PARAMETER_4%>"<%=parm4%>"
PARAMETER_5<%=PARAMETER_5%>"<%=parm5%>"
+ +

+ + <%-- Display our list of random Integers (shows code folding). --%> + +<% + if (intList != null && intList.size() > 0) { +%> + +<% + Iterator intListIt = intList.iterator(); + while (intListIt.hasNext()) { + Integer i = (Integer) intListIt.next(); +%> + +<% + } + } else { +%> + +<% + } +%> +
Here are the elements of intList...
<%=i.toString()%>
Oooops, we forgot to initialize intList!
+ +

+ + <%-- We can call javascript functions. --%> + + + + + + +
Test our javascript...
+ +

+ <%-- If we actually had defined a tag library. --%> + + +
+ + + + +
+ +

+ <%-- Expression language. --%> + + + + + + +
myParam's value: ""
+ + +<%! + /* A place for class variables and functions... */ + + // Define some sample parameter names that this page might understand. + private static final String PARAMETER_1 = "p1"; + private static final String PARAMETER_2 = "p2"; + private static final String PARAMETER_3 = "p3"; + private static final String PARAMETER_4 = "p4"; + private static final String PARAMETER_5 = "p5"; + + // Returns str trimmed, or an empty string if str is null. + private static String noNull(String str) { + String retStr; + if (str == null) + retStr = ""; + else + retStr = str.trim(); + + return retStr; + } + + // Returns a list of Integers with listSize elements. + private static List getIntList(int listSize) { + ArrayList retList = new ArrayList(listSize); + for (int i = 0; i < listSize; i++) + retList.add(new Integer( (int) (Math.random() * 100) )); + + return retList; + } +%> \ No newline at end of file -- cgit v1.2.1