Dynaview ID using Rewrite

Splash Forums Rewrite Users Dynaview ID using Rewrite

This topic contains 3 replies, has 2 voices, and was last updated by  Lincoln Baxter III 8 years, 7 months ago.

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



    I would like to know if it is possible to create a Rule that do the same as a Dynaview Rule in Prettyfaces.

    Thanks in advance,
    Marcio Alves


    Hi Marciodel,

    Yes, you can do this with a Rule configuration, but it would require some creativity πŸ™‚

    Basically you’d need to re-implement dyna-view using Rewrite rules; nothing should stop you from doing that, but there is nothing out-of-box that you can use today.

    You can, however, continue to use PrettyFaces configuration with Rewrite, so you still have that option.

    We could think about implementing DynaView in Rewrite. Would you like to assist or perhaps contribute the code for this? We could release it in the next version of Rewrite.




    Hi Lincoln,

    If I correctly undesrtood, I need to create a custom Rule that accepts an EL value expression in the “to()” field.
    Is this correct?



    Hmmm, well. You probably don’t need to create a custom Rule. You could, but you can probably achieve the same result simply by combining a few rules and EL methods. Depending on the scope of your bean, you may not even need to use EL at all, and you could possibly just inject it into the configuration directly.

    For that you will need to include the rewrite-integration-cdi.

    @Inject ViewBean bean;
    .perform(new HttpOperation() {
       public void performHttp(HttpServletRewrite event, EvaluationContext context) {
          Forward.to(bean.getView()).perform(event, context);

    Does that make sense?

    Otherwise, you can implement something like this (using FacesContext instead of PrettyContext):


    If you wanted to convert this to a rule, we could probably add it to the Rewrite Integration-Faces module.


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

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

Comments are closed.