serving common html without facelets/jsf-tags

I have the folder containing a client-side-html-template ("template.xhtml"). The folder resides in public folder (not in WEB_INF).

When saved the file with suffix "xhtml" and wrap the content with "<ui:composition", then client side (ajax) request can access.

However, when I save it to "template.html" and delete the "<ui:composition", then client ajax cannnot access this page (401).

My web.xml has this mapping:

        <servlet-name>Faces Servlet</servlet-name>
        <display-name>Restrict raw XHTML Documents</display-name>
        <auth-constraint />

How can I serve common "html-files" by client side ajax request without intercepting these files by jsf/facelets?

1 answer

  • answered 2018-01-11 20:59 nimo23

    Found a simple way without the need to change web.xml:

    I changed the static "html" files to "htm".