title: facelets: passing bean name with ui:param to action attribute
body: <p>Due to some custom components which expect a bean name (NOT the bean instance) in their attributes I need to pass the actual bean name between pages. As the bean itself is also used by non-custom components, I would like to avoid using additional <code>ui:param</code> (like described here <a href="https://stackoverflow.com/questions/1083834/passing-action-in-richmodalpanel">Passing action in &lt;rich:modalPanel&gt;</a>) since it will essentially specify the same bean.</p>
  
  <p>Is it possible to specify component's action using bean name provided with <code>ui:param</code>?</p>
  
  <p>Basically I am trying to achieve the following: </p>
  
  <pre><code>&lt;ui:composition xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  template="/template.xhtml"&gt;
  
     &lt;ui:param name="beanName" value="sessionBean"/&gt;
     ...
  
  &lt;/ui:composition&gt;
  </code></pre>
  
  <p>and template.xhtml is</p>
  
  <pre><code>&lt;ui:composition xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:a4j="http://richfaces.org/a4j"
  template="/someothertemplate.xhtml"&gt;
  
    &lt;/ui:define name="somename"&gt;
      &lt;h:form&gt;
          &lt;a4j:commandButton value="test" action="#{beanName.delete}"/&gt;
      &lt;/h:form&gt;
    &lt;/ui:define&gt;
  &lt;/ui:composition&gt;
  </code></pre>
  
  <p>Although delete method is properly defined (verified with <code>action="#{sessionBean.delete}"</code>) the above code gives me</p>
  
  <blockquote>
    <p>javax.faces.FacesException: #{beanName.delete}: javax.el.MethodNotFoundException: /template.xhtml @201,89 action="#{beanName.delete}": Method not found: sessionBean.delete()</p>
  </blockquote>