//Add.java package TLD; public class Add{ static int a = 10; static int b= 10; public static int add(){ return (a+b); } public static int playRandom(){ return (int) ((Math.random()*10)+1); } } //HowToUseJavaFunctionsInEL.jsp <%@ taglib prefix = "addition" uri = "addFunction"%>
| This no. is static : |
| ${addition:AddTheVariable()} |
| This no. is random : |
| ${addition:random()} |