[icedtea-web] RFC: add support for validating the deployment configuration
asu at redhat.com
Thu Dec 9 13:59:32 PST 2010
----- "Omair Majid" <omajid at redhat.com> wrote:
> From: "Omair Majid" <omajid at redhat.com>
> To: "Deepak Bhole" <dbhole at redhat.com>
> Cc: "IcedTea" <distro-pkg-dev at openjdk.java.net>
> Sent: Thursday, December 9, 2010 4:22:08 PM GMT -05:00 US/Canada Eastern
> Subject: Re: [icedtea-web] RFC: add support for validating the deployment configuration
> On 12/09/2010 03:43 PM, Deepak Bhole wrote:
> > * Omair Majid<omajid at redhat.com> [2010-12-09 12:12]:
> >> Hi,
> >> The attached patch adds support for validating the deployment
> >> configuration. This patch does not add any GUI or command line
> >> to do it manually (that will be addressed later).
> >> What this patch does is reject invalid values in all deployment
> >> configuration files and use the default ones. A
> >> deployment.properties file like:
> >> deployment.debug=foobar
> >> deployment.user.cachedir=file:///localhost/
> >> foo.bar=foo
> >> will make javaws detect the problems and use the default values
> >> Unknown setting "deployment.debug"
> >> Unknown setting "foo.bar"
> >> Error: setting "deployment.user.cachedir" has incorrect value
> >> "file:///localhost/". Using the default value
> >> "/home/omajid/.icedtea/cache" instead. Possible values include the
> >> absolute location of a file - it must begin with a /.
> > Looks okay to me. Not sure if we should be using a 'default' value
> > instead though.. what does the reference impl. do?
I think that if the value is invalid it should either be removed or revert to default values. Judging from how their control panel affects these values, let's say when you put invalid entries into the file, running the control panel simply will overwrite the file with valid entries + defaults.
I would assume that javaws is doing the same thing as reading the file and setting the correct values but just not writing to file like their control panel does.
> Hm.. good point, I hadnt checked that. I have tried it out now, and
> are my observations.
> I tried adding a few malformed and invalid entries and it seems to run
> without any problems. I tried using a url as a cache location (which
> not allowed) and I did not see any files being cached in the default
> location. As far as I can see, any invalid entries are silently
> and some sane value (_not_ necessarily the default value) is
> instead. In general, even with incorrect properties, javaws works - no
> error messages, nothing printed to the console and the invalid entries
> in the properties file are not modified.
> If you like, I can leave out the part where incorrect values are
> replaced with default values (after all, everywhere in the code where
> configuration is used, it is checked for being valid first) - the
> of the validation is still useful for doing command line and GUI
> validation and informing the user.
> The important thing, I suppose, is that we should somehow tell user
> something is wrong, but still run all JNLPs and applets.
More information about the distro-pkg-dev