This is quite easy to do. First you determine if the textbox will be disabled or not (this must be a string with true/false value, not disabled='true' as you were trying to do):
String isDisabled = String.valueOf(x == null || "".equals(x));
And then you disable the field:
<html:text property="firstName" style="width: 100px;" disabled="<%=isDisabled%>" />
See here for more documentation.
I don't remember exactly but I think you can also use a boolean directly:
boolean isDisabled = (x == null || "".equals(x));
<html:text property="firstName" style="width: 100px;" disabled="<%=isDisabled%>" />