Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JSTL and Struts - disabling a text field

843836Mar 23 2004 — edited Mar 24 2004
I am trying to disable a <html:text.../> field using JSTL and a property from the form. It will not work. Does anyone know the trick to making it work?

My Struts form bean has this (I've tried returning a boolean too, it still doesn't work.):

public String getDsblFld()
{
String out = Boolean.toString( !( isAdmin()) );
return out;
}

And the JSP has this:

<html:text property="accountName" size="15"
disabled="${editUserForm.dsblFld}"/>

However, if I do it using JSP code, it works, but I don't want to do it that way!

<%
boolean dsblFld = !((EditUserForm) request.getAttribute("editUserForm")).isAdmin();
%>
...
<html:text property="accountName" size="15"
disabled="<%=dsblFld%>"/>

How can I make it work using JSTL expressions? THANKS!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 21 2004
Added on Mar 23 2004
3 comments
289 views