All,

Short version of the question:
Is there a method somewhere in Tapestry that will return
"messages/Contact" if I pass it a class
com.blahblahblah.pages.messages.Contact?  I'm trying to pass a page name
to ComponentResources.createPageLink, and I don't want to hardcode the
page name...I'd like to use the class definition of the page, so if I
refactor and move the page around to different directories, my code
doesn't break.

Long version of the question:
I'd like to use ComponentResources.createPageLink to create a link.  The
quirk is that instead of giving it a hard-coded string that is the name
of a page, I'd like to instead use the name of the class, so that when I
refactor (and move the page from one directory to another), my hardcoded
string doesn't break.

Right now, I'm using this:
com.blahblahblah.pages.Contact.class.getSimpleName(), where "Contact" is
the name of the page.  This gives me a String that I can pass to
ComponentResources.createPageLink as a page name.

This works as long as the page is located in the package named
com.blahblahblah.pages.  However, if I want to create a subpackage

com.blahblahblah.pages.messages.Contact

then I can no longer use this (simpleName() returns "Contact", but the
createPageLink() method needs "messages/Contact").

So my question is this: is there a method somewhere in Tapestry that
will return "messages/Contact" if I pass it a class
com.blahblahblah.pages.messages.Contact?

Thanks,
Andy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to