Today, colleagues suddenly ask me, can the JSP page define functions. Today, I have never thought about this in MVC shaking flag. So I wrote a: <% @ page contenttype = "text / html; charset = GB2312"%>
<%! Int A (int i) {i = i ; returni}%> <% for (int K = 0; k <= 10; k ) {OUT.PRINTLN (A (k));}%> body>
This is HTML effect: 0 1 2 3 4 5 6 7 8 9 10