[size=medium][color=red]<%@ taglib prefix="myfun" uri="http://hellking.com/function"%> [/color][/size]
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ page contentType="text/html; charset=gb2312" language="java" %>
<%@ page isELIgnored ="false" %>
表达式语言的使用
提交的内容是:
${myfun:trans(param.name)}
另一个函数的使用,结果是:
${myfun:add(param["x"],param["y"])}
function函数如下:
package com.jspdev.ch16;
import java.io.*;
public class Function
{
public static String trans(String chi)
{
String result = null;
byte temp [];
try
{
temp=chi.getBytes("iso-8859-1");
result = new String(temp);
}
catch(UnsupportedEncodingException e)
{
System.out.println (e.toString());
}
return result;
}
public static int add(int x,int y)
{
return x+y;
}
}
在第一行下面有如下错误提示:Cannot find the tag librar descriptor for http://hellking.com/function。请问高人们怎么解决?谢谢!