Two cdi beans with the same rewrite @Join

Splash Forums Rewrite Users Two cdi beans with the same rewrite @Join

Tagged: , ,

This topic contains 3 replies, has 2 voices, and was last updated by  Christian Kaltepoth 5 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #27546

    Tsobis G

    In our project we use rewrite-servlet, rewrite-integration-cdi and rewrite-integration-faces (3.4.1).
    We use @Join annotation on the beans for the jsf rewrite eg
    This solution works perfectly for us. However, the last few days a requirement appeared which I do not know if it is possible with rewrite.

    We want two cdi beans to have the same @Join rewrite

    public class RecordList{}
    Public class CategoryList{}

    Can this be implemented with rewrite?
    Thanks in advance


    Why do you want two joins which are exactly the same? You only need it once to let Rewrite pick it up. So just remove it from one of your beans.


    Tsobis G

    Yes you are correct, I made a mistake.
    Basically what I want is too initialize multiple cdi beans from one url.
    records-list.jsf is a jsf page with two lists.
    A categories list and a records list. Which is simple, however, we want the categories list from a separate cdi bean since it will be used with another jsf file as well.
    Categories list + category creation view
    Categories list + category update view
    Categories list + records list
    Categories list + record creation view
    I do not want to repeat the code in all cdi beans for these jsf files, since it is not only load of a list but actions as well.
    The older version of the app was based on seam 2.2. The solution was simple, we only had to call the action tag multiple times.

    <page view-id="/page/products/product-category/products-list.xhtml">
            <rewrite pattern="/products/component/list/category={catid}/sortby={orderby}/page={page}"/>
            <rewrite pattern="/products/component/list"/>
            <param name="orderby" value="#{productsListPaging.orderBy}" required="true"/>
            <param name="page" value="#{productsListPaging.currentPage}" converterId="javax.faces.Integer" required="true"/>
            <param name="catid" value="#{productsListPaging.categoryId}" converterId="javax.faces.Long" required="true"/>
            <action execute="#{productsListPaging.init}"/>
            <param name="catid" value="#{categoriesPaging.categoryId}" converterId="javax.faces.Long" required="true"/>
            <action execute="#{categoriesPaging.init}"/>

    What do you mean with “initialize multiple cdi beans from one url”? What kind of initialization? If you are talking about @RequestAction, then you should use a standard <f:viewAction> instead.

Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘Rewrite Users’ is closed to new topics and replies.

Comments are closed.