admin@glassfish.java.net

Re: a question on config api

From: Shing Wai Chan <shing.wai.chan_at_oracle.com>
Date: Tue, 01 Feb 2011 18:27:17 -0800

If I do not set the default value, then I will get null for
ManagerProperties.getSessionFileName() when user does not specify element.
In our case, how can distinguish between not set and explicitly set it
to "".


On 2/1/11 4:48 PM, Jennifer Chou wrote:
> Actually, I think if you have a default value it will always return
> the default value if you don't set any value (set to "" or null).
> I guess you should not use the defaultValue on the attribute so you
> can set it to "" or null.
> Then maybe you can add a static field or method to return the default
> value? I don't know if that will work for you.
>
> On 2/1/2011 7:06 PM, Shing Wai Chan wrote:
>> cc. Tom
>> Any comment?
>> Shing Wai Chan
>>
>> On 2/1/11 3:32 PM, Shing Wai Chan wrote:
>>> Hi Jennifer,
>>>
>>> I have a question on admin backend. Hope that you can help me.
>>> There is a attribute in config-api/.../ManagerProperties.java:
>>> @Attribute
>>> public String getSessionFileName();
>>>
>>> Right now, the default is null.
>>> But internally, we have a default "SESSIONS.ser".
>>> There is a bug that we cannot unset this value.
>>>
>>> What is the best way to do that?
>>> I try to change it as follows:
>>> - @Attribute
>>> + @Attribute(defaultValue="SESSIONS.ser")
>>> public String getSessionFileName();
>>>
>>> and find that the admin backend will provide the default value
>>> "SESSIONS.ser"
>>> if we don't set a value for sessionFileName.
>>>
>>> What is the best way to resolve this?
>>> Is there anyway we can specify "" or null and has a non-empty
>>> default String?
>>>
>>> Please let me know.
>>> Thanks.
>>> Shing Wai Chan
>>>
>>>
>>