Thanks for the suggestions! > -why don't you let your content authors write these external links > explicitly (i.e. the full URL) into the HTML template?
A few reasons: - error prone - if an external link changes, the references need to be changed in several places (violates DRY principle) - links should be stored in a database and accessed by id, so the link contents become part of the programming domain, not the content domain - easier validation - easier to calculate click-through statistics - etc. This is interesting... Is my approach so different from what people are used to, or is it just that my description is really bad? Based on the various comments I've heard so far, I get the impression that I'm doing something really different... To me, this seems like a natural modelization for links that would fit well with the Wicket style of thinking. It keeps the concerns in the right places and adds effenciency to the development process, IMHO. > Ok, you probably have your reason why you don't use this. Do your > content authors use a separate tool to edit these links in your database? Simply because I think that this is in the domain of the webapp. Adding another tool adds too much complexity into the development process. > -why don't you route external links via a special page that immediately > redirects to the target page. > Then you could handle this case the same way as your internal links. URL > mounting is a great way to offer content authors arbitrary deep links > into your application. Never thought of that... I'll give this some thought. Could be a neat trick. :-) > -please take a look at IComponentResolver. > This nice interface gives you the possibility to 'lazily' add components > to the component tree. > This enables you to move most of your code into a custom component, > where imho this functionality (e.g. > > getLinkService().getLink()) would better be located. I agree that this code would be better located in a component. I'll check out this interface indeed. A priori, though, the problem I see remains, though is probably diminished: if a user changes locales during a given session, even if the component is added to the tree lazily, it will still remain there. So if in the new locale, a link that was there before but is not there now will cause an exception to be thrown. Thanks again for the input! ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
