Question

I have a phaseListener and more then one filter. I want to know if there is a way to create priority. I want phaseListener will be first and then all the filters. I am using the url mapping /* in web.xml for my filters.

Was it helpful?

Solution

I want phaseListener will be first and then all the filters.

That's not possible. The phase listeners are to be executed by the JSF faces servlet. However, by specification the filters are invoked before any of the servlets. You'd need to revise your approach. Apparently the phase listener actually needs to be a filter. This is quite good possible if you are not dependent at all on the faces context. The filter mapping can then just be placed in front of all other filter mappings in web.xml.

OTHER TIPS

When patterns match equally the processing order is determined by the order of the filter mappings in the descriptor (web.xml).

So if you want X to be first then list it first.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top