Passing the backing bean as a parameter to a Facelet include

前端 未结 2 1585
不知归路
不知归路 2020-11-29 12:22

I have a Facelet that might be used in different applications. I don\'t to copy it, but reuse it. I need to pass the backing bean that will manage the view as a parameter,

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-29 12:55

    Because I would have found it helpful yesterday, when I was looking for this, here is a simple version of how to do this, without the extraneous template, defines and namespaces:

    File1.xhtml (the root tag doesn't matter)

    
      
    
    

    File2.xhtml

    
      
    
    


    You can also nest further in the same manner.

    File1.xhtml

    
      
    
    

    File2.xhtml

    
      
        
      
    
    

    File3.xhtml

    
      
    
    

提交回复
热议问题