Define functions in JSP

xiaoxiao2021-03-06  58

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));}%>

This is HTML effect: 0 1 2 3 4 5 6 7 8 9 10

转载请注明原文地址:https://www.9cbs.com/read-82248.html

New Post(0)