"Geir Magnusson Jr." wrote:
>
> Opinions :
>
> 1) I think we should change the error() method from private final to
> protected. That way, a derived class can do the error handling and do
> something useful (log, send email, panic...). Currently it just spews
> some HTML.
>
> 2) I would like to change init() to turn the properties file into a
> j.u.Properties, and then pass that to a routine :
>
> protected void alterInitProps( ServletConfig config, Properties props
> )
>
+1, but use a nicer name, e.g. prepareProperties.
I have a counter suggestion: make the properties loading an overridable
method:
...
Properties p = new loadProperties(propsFilename);
Runtime.init( p );
...
protected Properties loadProperties( propsFilename )
{
Properties p = new Properties();
p.load(propsFilename);
return p;
}
In this way you can do fancy setup, merge you own stuff in, etc.
Your subclass would just do:
protected Properties loadProperties( propsFilename )
{
Properties p = super.loadProperties(propsFilename);
... do you stuff here
}
:) Chirstoph