注册 登录
编程论坛 J2EE论坛

请问给自定义标签的属性赋值可以使用el表达式吗

非凡DZ 发布于 2007-11-27 14:37, 1608 次点击
如题
<%@ page c %>
<html>
<head>
<title>
index
</title>
</head>
<body bgcolor="#ffffff">
<h1>
First Page
</h1>
<form action="second.jsp" method="GET" name="frm">
要修改的用户名<input name="userName"/>
<br />
修改后的密码<input type="password" name="password"/>
<br />
<input type="submit" value="提交"/>
</form>
</body>
</html>

second.jsp
-----------------------------------------------------------------------------------------------
<%@ page c %>
<%@ taglib prefix="dz" uri="WEB-INF/myTlds/emptyContainer.tld" %>
<html>
<head>
<title>
index
</title>
</head>
<body bgcolor="#d485d5">
<h1>
Second Page
</h1>
修改前的用户信息表
<%//String name = request.getParameter("userName"); %>
<dz:henry tableName="userInfo" user="${param.userName}" pass="${param.password}">
小写变大写chinese
</dz:henry>
修改后的用户信息表
<dz:henry tableName="userInfo"/>
</body>
</html>

-------------------------------------------------------------------------------------------------------


我这么用总是提示我user不能得到值,请大家帮忙指点,谢谢
2 回复
#2
无缘今生2007-11-28 14:46
EL是JSP2.0默认支持的,应该没问题的呀.
顺便问一下,你用的是什么服务器.

如果你用使用上面你注释掉的那个get可能不能取得值呢.
#3
非凡DZ2007-11-29 19:19
问题解决了

在.tld文件中需要加上这句话<rtexprvalue>true</rtexprvalue>
1