I have a simple question, but can not find a solution. Assume, all my XHTML files are located in webapp under the folder “mod”. I would like to avoid the need to type /mod/… in URLs. How can I rewrite URLs with the Rewrite, so that all requests get a prefix “mod” when resolving against real paths? For instance, when somebody types as URL
it should be resolved (mapped) to
I’ve tried with
public Configuration getConfiguration(ServletContext context)
but no luck. Can one help me? Thanks in advance and sorry for this stupid question.
I found that there is a problem even without Configuration when Rewriter with JSF und CDI modules is in the classpath. We get logged in Principal object from the request object. Principal object is put into HttpRequest by a special security filter. When Rewriter with JSF / CDI modules is added to the project (only dependencies), the Principal object is null (and we get NPE). Any ideas?
This reply was modified 3 years, 9 months ago by Oleg.
It works with PrimeFaces <p:button …/> (full page GET request).
It works with <p:commandButton …/> (AJAX request per default)
It DOESN’T WORK with <p:commandButton ajax=”false” …/> (full page POST request).
In the third case I can see added windowId with every full page POST request. E.g. after 3 requests:
It works fine technically. Extra CDI parameters are annoying :-). I could avoid Rewrite parameters (in the example &page=index.html&page=index.html) by adding rules without binding (you know what I mean), but CDI parameters are still here.