admin@glassfish.java.net

Re: side effect of not specifying default attribute in domain.xml

From: Kedar Mhaswade <Kedar.Mhaswade_at_Sun.COM>
Date: Tue, 23 Sep 2008 13:57:58 -0700

Anissa Lam wrote:
> Hi,
>
> I am looking at issue# 6262 regarding launch link disappers in admin
> console for running deployed web apps.
>
> I think there is a side effect of default attribute not specified in
> domain.xml, as Jerome made the changes last week.
> For the case of http-listener, enabled attribute is not specified.
> <http-listener default-virtual-server="server" server-name=""
> address="0.0.0.0" port="8080" id="http-listener-1">
>
> In my code, i tested if httpListener.getEnabled() returns "true". If it
> doesn't return true, the code thinks it is not enabled. AMX is
> returning null which is correct, i guess. This is just a specific
> case, and maybe I can put in the code saying returning null means
> enabled, which i really want to avoid.


I agree. But why is AMX returning null?
If the default value is present, shouldn't AMX be returning it, e.g.
"true" in this case for HttpListener which has:

     @Attribute (defaultValue="true", dataType=Boolean.class)
     public String getEnabled();

I do get:
configs.config.server-config.http-service.http-listener.http-listener-1.enabled=true

on

querying:
asadmin get "*" | grep http-listener

-Kedar

(I also think that this was rather late binding change though it trimmed the
domain.xml tremendously).

>
> For boolean attribute, the default may be true or may be false. It is
> very hard for me to check for null and then ask for the default value,
> compare that and made decision for every attribute.
>
> We can either put back the default value if it is boolean, or AMX
> should return the default value if the attribute has no value specified
> in domain.xml.
>
> Btw, most of the admin gui pages now doesn't show any value, because we
> are displaying whatever AMX returns for the attribute, and since the
> attribute is not specified in domain.xml, i am getting lots of empty
> strings or null, and that is what user sees. This is very different
> than before. Please see attached image.
>
> Maybe AMX code should return the default value if the attribute is not
> specified in domain.xml ? what do you think ?
>
> thanks
> Anissa.
>
> ------------------------------------------------------------------------
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net