aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Whats Wrong? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Whats Wrong?" Watch "Whats Wrong?" New topic
Author

Whats Wrong?

Pawan Ramchandani
Ranch Hand

Joined: Aug 15, 2003
Posts: 78
Help Me

Error:- Invalid syntax for function signature in TLD. Tag Library: d, Function: do


Function:-

package foo;

public class Test
{
public static void print()
{
System.out.print("Hello WOrld");
}

}


TLD:-

<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

http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<tlib-version>1.2</tlib-version>

<uri>Rendom</uri>
<function>
<name>do</name>
<function-class>foo.Test</function-class>
<function-signature>void print()</function-signature>
</function>
</taglib>


JSP:-

<%@ taglib prefix="d" uri="Rendom"%>

<html><body>

${d o()}

</body></html>



Thanks
[ October 02, 2004: Message edited by: Pawan Ramchandani ]

Pawan Ramchandani<br />*******************************<br />SCJP 1.4<br />SCWCD <br />*******************************<br />Everything is okay in the end. If it's not okay, then it's not the end.
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
Do you need the "void" in the function signature, or is the return type only specified in the TLD when you actually return something?


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
Romy Huang
Ranch Hand

Joined: Sep 30, 2003
Posts: 35
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 ]
Sohil Ladhani
Greenhorn

Joined: Dec 15, 2012
Posts: 1
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 ]


Try <function-signature>int rollDice()</function-signature> (i.e. in the single line) in the TLD file. It worked for me. May be it is the correct syntax.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Whats Wrong?