The_Developer wrote:
Hi,
I've been trying to use scriptlets and/or <bean:write> tags inside
<html:select onchange=""> and <html:button onclick=""> tags. However it
seems that in either case the expression is not evaluated at runtime. The
end result is something like this
<html:select onchange="javascript:update('<bean:write
name='productId'/>)">abc</html:select> and
<html:button onclick="javascript:update('<bean:write name='productId'/>)"/>
when the I intended the output to be something like
<html:select onchange="javascript:update('5)">abc</html:select> and
<html:button onclick="javascript:update('5')"/>
Does anyone know why this is happening or am I making a mistake?
Many Thanks
You're making a mistake: what you have is not valid JSP syntax. It is
not legal to use a JSP custom action within an attribute of another
custom action. Instead, use RT expressions or, preferably, JSTL EL:
<html:select onchange="javascript:update('<%=...%>')" ...
<html:select onchange="javascript:update('${...}')" ...
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]