开发者

empty keyword in Struts

Is there an empty keyword in Struts 2 (like in JSP)?

For example in JSP I write:

<c:if test="${empty var}">

Thanks开发者_JAVA技巧


Just test for null.

And to acheive the same effect than the JSTL empty keyword with strings (which means "null or empty"), you need two checks (yes it is tiresome):

<s:if test="foo != null && foo != ''">
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜