// Need to push several items onto the stack now as we recurse
// into another menu model.
_saveModelData();
// Create the sub menu model specified in the sharedNode
XMLMenuModel menuModel = (XMLMenuModel)MenuUtils.getBoundValue(expr,
Object.class);
// Now must pop the values cause we are back to the parent
// model.
_restoreModelData();
recurseLevel = (Integer) requestMap.get(_RECURSE_COUNTER);
recurseLevel --;
requestMap.put(_RECURSE_COUNTER, recurseLevel);
if(recurseLevel == 0)
requestMap.remove(XMLMenuModel.SHARED_MODEL_INDICATOR_KEY);
// Name of the managed bean that is the sub menu XMLMenuModel.
String modelStr = expr.substring(expr.indexOf('{')+1,
expr.indexOf('}'));
// There are 2 ways that a Model can be invalid:
// 1) Something such as a missing managed bean definition
// for the submenu model causes the creation of the
// XMLMenuModel for the submenu to fail. This will result
// in menuModel being NULL.
// 2) Some kind of parsing error in its metadata. If a node
// type is invalid, an exception will be thrown (see below)
// and caught in getTreeModel(). This will result in a
// null submenu list the following SAXException will also
// be logged.
if (menuModel != null)
{
Object subMenuObj = menuModel.getWrappedData();
List<MenuNode> subMenuList = null;
if (subMenuObj instanceof ChildPropertyTreeModel)
{
subMenuList =