click-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Schellink <sab...@gmail.com>
Subject Re: Confusing page class mapping
Date Sun, 20 Jun 2010 10:19:43 GMT
On 20/06/2010 18:26, Adrian A. wrote:
> I always thought that the whole point of "package" attribute was to be
> used in conjunction with automapping, and when automapping is false,
> than just to shorten the code by specifying the "common" package part of
> all pages only once (since there might be hundreds of pages).


This isn't correct. The package is used whether automapping is on or off. I don't think anyone
would
switch off automapping so we can just assume it is always true. The question comes with how
the
manual mapping occurs inside the pages element:

<pages package="org.mycorp.page">
  <page path=".." classname="Index"/>
  <page path=".." classname="customer.MyPage"/>
</pages>

The "classname" Index looks OK, but "customer.MyPage" doesn't. Calling it "classname" is misleading
because it is neither the full nor the simple classname. Its more of a postfix.

If you look around the docos you'll see many references to absolute classnames eg:

  <page path="error.htm" classname="org.mycorp.ErrorPage"/>

Where the confusion seems to come in is people interpret the classname as absolute even when
the
package is specified, at which point the classname becomes relative.

My suggestion is that we load the class with the package prefix as we do now and if it isn't
found,
try against the given classname.

This should clear up the confusion.

Bob


Mime
View raw message