关于:
<%@ taglib prefix="myfun" uri="http://hellking.com/function"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ page contentType="text/html; charset=gb2312" language="java" %>
<%@ page isELIgnored ="false" %>
<html>
<head>
<title>表达式语言的使用</title>
</head>
<body bgcolor="#FFFFFF">
<hr>提交的内容是:
${myfun:trans(param.name)}
<hr>
<form action="function.jsp" method=get name=form1>
<input type=text name="name">
<input type=submit value=提交>
</form>
<hr>
<hr>
另一个函数的使用,结果是:
${myfun:add(param["x"],param["y"])}
<form action="function.jsp" method=get name=form2>
<input type=text name="x">
<input type=text name="y">
<input type=submit value=提交>
</form>
</body>
</html>
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。请问高人们怎么解决?谢谢!