我编写了自己的taglib,我想在我的jsp页面中使用它。但是我对像这样的<%! String test= "lot of print test"; %>到页面的传输字符串声明有问题。
我的.tld
<function> <name>Upper</name> <function-class>my.ChangeCase</function-class> <function-signature> java.lang.String Upper(java.lang.String) </function-signature> </function>
我的.java
public static String Upper(String text) {
String up;
up = text.toUpperCase();
return up;
}我的.jsp
<%@ taglib prefix="my" uri="/WEB-INF/tlds/newTag" %>
upper${my: Upper("how send string here?")}问题是如何将字符串发送到函数Upper?
发布于 2014-12-18 23:53:07
您可以只使用upper${my:Upper(test)}。
附注,您可以将您的函数简化为
public static String Upper(String text) {
return text.toUpperCase();
}https://stackoverflow.com/questions/27550552
复制相似问题