0 Replies Latest reply on Jul 18, 2012 2:30 PM by fpalma

    How to prevent direct access to files?

    fpalma

      Hello to all,

       

      I'm using JSF 2, and I have all my xhtml files under "/src/main/webapp/", so I can access directly to this files writing his name on the navigator.

      I want to hide the files in "/src/main/webapp/WEB-INF/views" for example.

       

      If I modify the file faces-config.xml with this:

       

        <from-view-id>/home.xhtml</from-view-id>

       

        <navigation-case>

              <from-outcome>success</from-outcome>

              <to-view-id>/WEB-INF/views/welcome.xhtml</to-view-id>

        </navigation-case>

       

          <navigation-case>

              <from-outcome>nowelcome</from-outcome>

              <to-view-id>/WEB-INF/views/nowelcome.xhtml</to-view-id>

        </navigation-case>

       

      It functions halfway, for example I can navigate from home.xhtml to welcome.xhtml, but I can not make actions from welcome.xhtml to itself (this works with the files under /src/main/webapp/)

       

      How can I do to prevent direct access to the files? I'm not using web.xml.

      Thank you very much,

       

      Fran