HI friends...
I am trying to implement the rollIt program of HRSJ, but I am encountering some problem in excuting my rollIt function.
Here is my code :
TestBean.jsp
<%@ taglib prefix="mine" uri="DiceFunctions" %>
<html>
<body>
${mine:rollIt()}
</boby>
</html>
=========================================================================
Tld file : <?xml version="1.0" encoding="ISO-8859-1" ?>
<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>
=========================================================================
My rollDice function package foo;
public class DiceRoller {
public static int rollDice()
{
return (int)((Math.random() * 6 ) + 1);
}
}
===========================================================================
Out which I am getting is :
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: The class specified in the method signature in TLD for the function mine:rollDice cannot be found.
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:94)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:365)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:216)
at org.apache.jasper.compiler.Validator$1$MapperELVisitor.visit(Validator.java:1380)
at org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:159)
at org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:230)
at org.apache.jasper.compiler.ELNode$Visitor.visit(ELNode.java:268)
at org.apache.jasper.compiler.ELNode$Root.accept(ELNode.java:92)
at org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:230)
at org.apache.jasper.compiler.Validator$ValidateVisitor.getFunctionMapper(Validator.java:1395)
at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:669)
at org.apache.jasper.compiler.Node$ELExpression.accept(Node.java:821)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2017)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2059)....................................................................................................
===========================================================================
I dont understand why it is not executing the function and printing the statement as it is...
........................................................................
thanks,
Pooja