JSTL and Scriptlet

Hi,

I take back a code from another developer, I get an error and I don't understand why. RAD 7 tells me "media cannot be resolved" in the scriptlet.

Could you help me to understand why ? There is may be another way to do the same.

Thanks

<bean:define id="media" name="accountForm" property="media" type="java.lang.Short" scope="request"/>

<%boolean postDisabled = media.intValue() != MyConstant.POST %>

<html:radio property="groupedPost" value="true" disabled="<%=postDisabled%>" ><bean:message key="account.grouped"/></html:radio>

[853 byte] By [Sebastien.Bervoetsa] at [2007-11-27 11:02:38]
# 1

> scope="request"

The bean is stored in the request. To get it from a scriptlet, use:

Short media = (Short) request.getAttribute("media");

gimbal2a at 2007-7-29 12:44:39 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...