Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
Romy Huang wrote:I have problem with this too.
Error message:
org.apache.jasper.JasperException: The class specified in the method signature in TLD for the function mine:rollIt cannot be found.
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:94)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:404)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:219)
org.apache.jasper.compiler.Validator$1MapperELVisitor.visit(Validator.java:1405)
org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:163)
org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:234)
org.apache.jasper.compiler.ELNode$Visitor.visit(ELNode.java:275)
org.apache.jasper.compiler.ELNode$Root.accept(ELNode.java:94)
org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:234)
org.apache.jasper.compiler.Validator$ValidateVisitor.getFunctionMapper(Validator.java:1420)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:637)
org.apache.jasper.compiler.Node$ELExpression.accept(Node.java:913)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2180)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2230)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2236)
org.apache.jasper.compiler.Node$Root.accept(Node.java:485)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2180)
org.apache.jasper.compiler.Validator.validate(Validator.java:1515)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:247)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:552)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
JSP page:
<%@ taglib prefix="mine" uri="DiceFunctions" %>
<html>
<body>
${mine:rollIt()}
</body>
</html>
Function:
package foo;
public class DiceRoller
{
public static int rollDice()
{
return (int) ((Math.random()*6)+1);
}
}
TLD:
<?xml version="1.0" encoding="UTF-8" ?>
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
version="2.0">
<tlib-version>1.2</tlib-version>
<uri>DiceFunctions</uri>
<function>
<name>rollIt</name>
<function-class>
foo.DiceRoller
</function-class>
<function-signature>
int rollDice()
</function-signature>
</function>
</taglib>
[ October 04, 2004: Message edited by: Romy Huang ]
Poop goes in a willow feeder. Wipe with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|