It looks like you've attempted to set a local instance property (id)
before the ModelBean instance was injected into the ShowSurvey bean instance. You did that by doing the assignment in open code within the ShowSurveyBean. Open code gets collected by the
java compiled and placed into an anonymous internal init method. Static init code goes into a similar anonymous method (_clinit). These methods are run at "new" time, before the container (
JSF) has had an opportunity to inject any properties.
To resolve this, you can either add a "@PostConfig" method to ShowSurveyBean or simply defer the initialization until the first time you need the id property OR you can simply not use the local id property and pull the id directly from modelBean when you need it.
A PostConfig annotation on a public void method tells JSF that this method will be invoked AFTER JSF has injected all the managed properties, but BEFORE any actual application processing is done.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.