• No replies
1 Post

Pinned topic Problems using user defined functions in EL via a TLD file

‏2011-11-19T15:57:57Z |

I try to follow a simple example form a book on how to do a simple function usable in EL (Expressionless Language) in RSA .
Looks to me I do it the right way but something must be wrong as it doesn't work.
Appreciate all help and hints

First I make the function itself in Java Resources\src\foo

package foo;

public class DiceRoller {
public static int rollDice(){
return (int)((Math.random() * 6) + 1);

Pretty straightforward code to return an int between 1 and 6.
Get no errors or warnings here.

Then I put the TLD file myFunctions tld in the WEB-INF directory


<?xml version="1.0" encoding="ISO-8859-1" ?>

<taglib xmlns="" xmlns:xsi="" xsi:schemaLocation="" version="2.0">

int rollDice()


I get the following warning here :
Description Resource Path Location Type
No grammar constraints (DTD or XML schema) detected for the document. myFunctions.tld FirstWeb/WebContent/WEB-INF line 1 XML Problem

This might be the problem but the code looks like other examples I have seen on the web.
But please comment this message if you have any hints. Version No comes at hand but have tried to change them without a fixing the problem and I haven't managed to find any info on tag lib versions supported by RSA (So if you know about versions please comment) I wish there was a "new TLD" function in RSA to be sure all the headings was correct.

Finally a simple JSP to use it in the WebContent directory


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><%@page
language="java" contentType="text/html; charset=ISO-8859-1"
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="GENERATOR"
content="Rational Software Architect for WebSphere Software">

<%@ taglib prefix="mine" uri="DiceFunctions" %>

Let us see what the dice will roll!!!




On this page I actually get a Syntax error on the EL expression, but it looks all right to me according to samples I have seen.

As I said all help and hints appreciated.

Best Regards