i think mountPackage(String path, Class clazz) looks funny. where is the package you are trying to mount? i think it is up to the user to provide a package with a valid name, if the package has an empty string for the name it will be mounted as / . we can also pirnt out a warning in the log. i will factor in mount path into the encoder so that we do not have to keep it in two places.

-Igor





On 12/11/05, Johan Compagner <[EMAIL PROTECTED]> wrote:
This method has to be rewritten:

public final void mountPackage(String path, Package packageToMount)
    {
        if (!path.startsWith("/"))
        {
            path = "/" + path;
        }

        mountPath(path, new PackagePathMountEncoder(path, packageToMount));
    }

to not use the Package object (so that users don't have to do MyClass.class.getPackage())

Because getPackage() doesn't have to return the package it can also return null (and we know that because we already had these problems in wicket!!)

So my fix would be to also give the class object in that method:

public final void mountPackage(String path, Class classForThePackage)
    {
        if (!path.startsWith("/"))
        {
            path = "/" + path;
        }

        mountPath(path, new PackagePathMountEncoder(path, classForThePackage));
    }


and then we can look inside our code if the Package object is there or else extract it as a string from the classname.

johan

Reply via email to