wok*_*ena 1 java attributes jsp
我有JSP标签的问题 - 如何在Java代码中插入属性值?这是我的代码:
<%!
String ii = new String();
%>
<%
try {
String id = request.getParameter("a");
int i = Integer.valueOf(id);
ii = String.valueOf(i);
} catch (Exception e) {
response.sendError(500);
}
%>
<div style="float:right;margin-right:20px;">
<strong>From: </strong> <em><post:ShowPm postId="<%=ii%>" /></em><br>
</div>
Run Code Online (Sandbox Code Playgroud)
如果我运行它,发生错误500 - 堆栈 第48行是这段代码:
<strong>From: </strong> <em><post:ShowPm postId="<%=ii%>" /></em><br>
Run Code Online (Sandbox Code Playgroud)
我使用Struts 1和JSP使用自己的标签(是我的标签).
听起来你需要更改你的tld,以便属性可以接受表达式:
<attribute>
...
<rtexprvalue>true</rtexprvalue>
...
</attribute>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
175 次 |
| 最近记录: |