/** * Initialize this request object - overridden from base class. * * @see xp://scriptlet.xml.XMLScriptletRequest#initialize */ public function initialize() { parent::initialize(); if ($this->stateName) { $name = implode('', array_map('ucfirst', array_reverse(explode('/', $this->stateName)))); try { $this->state = XPClass::forName($this->package . '.' . ('state.' . $name . 'State'))->newInstance(); } catch (ClassNotFoundException $e) { throw new ScriptletException('Cannot find ' . $this->stateName, HttpConstants::STATUS_NOT_FOUND, $e); } } }