0

This is my xhtml

<f:metadata>
 <f:viewParam name="roleid" value="#{roleBean.roleid}"/>
 <f:event type="preRenderView" listener="#{warManagedBean.generatewar()}"/>
 </f:metadata>

This is my code in

@ManagedBean(name = "roleBean")
@SessionScoped
public class RoleBean implements Serializable{

    private String x;
    private String y;
    private String z;
    private String roleid;

Here i am trying to pass the id as a parameter to next page and it should retrieve values based on that id. When i pass the bean id as a parameter to next page i get error

"#{rolebean.roleId}": Target Unreachable, identifier 'roleBean' resolved to null

This is the value from the column from the first xhtml page which i carry to next xhtml

<h:column>
 <f:facet name="header">
 <h:outputText value="RoleID" />
 </f:facet>
 <h:link outcome="info">
 <h:outputText value="#{roleBean.roleid}" style="white-space:nowrap"></h:outputText>
  <f:param name="roled" value="#{roleBean.roleid}">
</f:param>
  </h:link>
 </h:column>
Deploying
  • 1
  • 1
  • 1
    Code doesn't match the error. Is it `#{bean}` or `#{beanBean}`? – BalusC Feb 04 '14 at 21:55
  • /info.xhtml @12,81 value="#{roleBean.roleId}": Target Unreachable, identifier 'roleBean' resolved to null:: complete error line – Deploying Feb 04 '14 at 22:04
  • `roleId` (in xhtml) is not the same as `roleID` (in bean). Not sure if it related to message. – Vasil Lukach Feb 04 '14 at 22:38
  • They are actually same. i ve posted it wrongly. Edited now – Deploying Feb 04 '14 at 22:44
  • provided some more info n code – Deploying Feb 04 '14 at 22:51
  • Still not correct: in `f:viewParam` is **rolebean**, but in `h:outputText` and `ManagedBean` is **roleBean**. – Vasil Lukach Feb 05 '14 at 04:06
  • Lesson for future questions: **copypaste real working code unmodified** instead of using the question editor as code editor. Otherwise your chances on getting an answer will greatly implode due to all those red herrings in the code caused by incapability of writing valid code off top of head. See also the introduction of the http://stackoverflow.com/tags/jsf/info – BalusC Feb 05 '14 at 09:12
  • BalusC - i ll keep that in mind from now on. Anyways, my issue is resolved. Thanks all :) – Deploying Feb 05 '14 at 17:56

0 Answers0