if(this.logger.isLoggable(Level.INFO))
{
this.logger.info(pageDefinitionClass.getName() + " will be used as page-definition.");
}
ViewConfigEntry newEntry = createViewConfigEntry(pageDefinitionClass);
if(newEntry != null)
{
ViewConfigEntry existingEntry = ViewConfigCache.getViewDefinition(newEntry.getViewDefinitionClass());
//TODO introduce an SPI with a better name
if(/*viewConfigEntry != null*/existingEntry instanceof DefaultViewConfigEntry
&& ((DefaultViewConfigEntry)existingEntry).isSimpleEntryMode())
{
//in this case the alternative view-controller approach which just adds page-beans was invoked before
//-> we just have to use the page bean of the existing entry
//here we have a simple-entry! (which just contains page-bean definitions)
for(PageBeanConfigEntry pageBeanConfigEntry : existingEntry.getPageBeanDefinitions())
{
//add page-beans to the real entry
newEntry.addPageBean(pageBeanConfigEntry.getBeanClass());
}
ViewConfigCache.replaceViewDefinition(newEntry.getViewId(), newEntry);