动态设置bean:message的参数 arg0

Rhett 2004-07-21 05:54:32
动态设置bean:message的参数 arg0

<bean:message key=”info.myKey” arg0=”5” arg1=”6” arg2=”7” arg3=”8”/>

其中arg0需要通过<bean:write/>获得,请问该如何实现

谢谢!
...全文
332 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
Rhett 2004-07-22
  • 打赏
  • 举报
回复
用arg0="<bean:write />"(双引号)出错如下:
org.apache.jasper.compiler.ParseException: /folist.jsp(210,184) Attribute it has no value

at org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:563)

at org.apache.jasper.compiler.JspReader.parseTagAttributes(JspReader.java:681)

at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java:838)

at org.apache.jasper.compiler.Parser.parse(Parser.java:1145)

at org.apache.jasper.compiler.Parser.parse(Parser.java:1103)
.....................省略许多

用用arg0='<bean:write />'(单引号),没有错误,但是无法将参数变量的值传过去
dafei0320 2004-07-22
  • 打赏
  • 举报
回复
关注先!!!!!~~~~~`
学习后~~~~~~~~~`!!!
fanciex 2004-07-22
  • 打赏
  • 举报
回复
错误贴出来
Rhett 2004-07-22
  • 打赏
  • 举报
回复
结果无法出来。用了jstl。

我采用<%=Variable%>实现了,虽然不太好。
fanciex 2004-07-22
  • 打赏
  • 举报
回复
我没环境,无法试...
fanciex 2004-07-22
  • 打赏
  • 举报
回复
用arg0='<bean:write />'(单引号),没有错误,但是无法将参数变量的值传过去
---
传过去的是什么?<bean:write />字符串吗?


试试用<c:out 传变量,我一般都是这样用;如果还不行那说明<bean:message不支持tag嵌套
朋友别哭 2004-07-21
  • 打赏
  • 举报
回复
up
Rhett 2004-07-21
  • 打赏
  • 举报
回复
好像不可以,出错
fanciex 2004-07-21
  • 打赏
  • 举报
回复
<bean:message key=”info.myKey” arg0='${xx.yy0}' arg1=”6” arg2=”7” arg3=”8”/>

<bean:message key=”info.myKey” arg0='<c:out value="${xx.yy0}" />' arg1=”6” arg2=”7” arg3=”8”/>
fanciex 2004-07-21
  • 打赏
  • 举报
回复
直接不行吗?
<bean:message key=”info.myKey” arg0='<bean:write />' arg1=”6” arg2=”7” arg3=”8”/>

<bean:message key=”info.myKey” arg0='<c:out value="5" />' arg1=”6” arg2=”7” arg3=”8”/>

Rhett 2004-07-21
  • 打赏
  • 举报
回复
刚才找到一个方法

<bean:define id= "realValue " >
<bean:message key= "customer.label " / >
</bean:define >
<bean:message key= "field.lookupbutton " arg0= " <%=realLabel% > "/ >

这个用了一小段jsp代码;

不知道bean:message支持下面的方法不?
<bean:message key= "field.lookupbutton ">
<设置参数arg0><bean:write name="xx" property="yy0"/></设置参数arg0>
<设置参数arg1><bean:write name="xx" property="yy1"/></设置参数arg1>
<设置参数arg2><bean:write name="xx" property="yy2"/></设置参数arg2>
</bean:message>

对标签熟悉的朋友帮帮忙!
fanciex 2004-07-21
  • 打赏
  • 举报
回复
吃饭先

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧