While calling the static method of a Java class from tld , I am facing some issues like while running the jsp file it always display this ${test:concat("java")}
as an output it's not even calling the java class.
index.jsp File
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="test" uri="/WEB-INF/SubstrDescriptor.tld"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
<title>JSP Custom Taglib example: Substr function</title>
</head>
${test:concat("java")}
</html>
SubstrDescription.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/web-jsptaglibrary_2_0.xsd"
version="2.0">
<tlib-version>2.0</tlib-version>
<function>
<name>concat</name>
<function-class>java4s.Demo</function-class>
<function-signature>java.lang.String doMyStuff( java.lang.String )
</function-signature>
</function>
</taglib>
Demo.java
package java4s;
public class Demo {
public static String doMyStuff( String myparam )
{
System.out.println(myparam);
return myparam;
}
}