At the moment I am using the following code:
public void init() {
question = questionBean.findQuestion(questionParamId);
}
Which is invoked by this:
<f:metadata>
<f:viewParam name="id" value="#{questionShowBackingBean.questionParamId}" />
<f:event type="preRenderView" listener="#{questionShowBackingBean.init}" />
</f:metadata>
So the URL is: http://www.mycompany.com/show.xhtml?id=8
Now I have begun using PrettyFaces and I have seen the <action>
element in the URL-mapping element I wonder if I could have written <action>#{questionShowBackingBean.init}</action>
instead?
If so should I remove metadata element then, or should I use that instead because it may in the future change from using PrettyFaces? Last, where does the invocation in the action
element occur? Does it occur before the listener I have now?