Ignore JSF resources

Splash Forums Rewrite Users Ignore JSF resources

This topic contains 4 replies, has 3 voices, and was last updated by  fabricciois 2 years, 2 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #26254



    I am migrating my system of PrettyFaces to Rewrite and I have a problem, when I try to create a rule that ignores JSF resources, for example, if I put this in my browser
    http://localhost:8080/rewrite/testing/sat the system shows me that the resource is not available (Error 404)

    This is my rule:

           		 .perform(PhaseOperation.enqueue(new IgnorePostbackOperation(Invoke.binding(El.retrievalMethod("systemAction.app")))

    how can i make JSF resources are ignored?, my param1 can take almost any value, I have 15 values ​​for param1 reserved
    Thank you very much for your help


    Hey! The best way I’ve found to do this is to make sure you use the Resource.exists() condition, you can also use the ServletMapping.includes(). For instance:

                    * Block direct file access.
                    * Application Routes


    Hi Lincoln:

    Thank you very much for your answer, in my case, I think I could not use Resource.exists() because the parameters(param1, app) can take almost any value, I am implementing something like the profiles of social networks. My problem is when I access http://localhost:8080/rewrite/testing/sat. the method app() of my ManagedBean (SystemAction) runs multiple times, because JSF resources also filter such as: http://localhost:8087/rewrite/javax.faces.resource/jsf.js.xhtml?ln=javax.faces

    thanks for your help, again.


    You could also try to create a custom contraint for the parameter. This way you can write some custom code that checks whether the parameter has the “correct” format. Something like:

    .where( "param1" ).constrainedBy( new Constraint<String>() {
      public boolean isSatisfiedBy( Rewrite event, EvaluationContext context, String value ) {
        return !value.contains( "javax.faces" );
    } )


    Thank you very much, that solved my problem.

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

You must be logged in to reply to this topic.

Comments are closed.