0
votes

I have a JSF 2.0 project wiht lots of .xhtml files. Due to a security filter I want to put some of the files in a /secure folder to then aply the filter on.

I tried simply moving the files to a folder. But then I get an exception

"/selectRole.xhtml Not Found in ExternalContext as a Resource"

Do I need to add something to the faces-config or web.xml?

1
Which security filter do you use ? In case of spring-security you should check application-context.xml as well.Maxim Manco
I have built my own and I the filter I'm making a redirect res.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY); res.setHeader("Location", baseURI + "selectRolej.xhtml" + "); res.flushBuffer();Stefan Rasmusson

1 Answers

1
votes

Your application is trying to read /selectRole.xhtml from a bean, or redirect action.

In JSF2, the navigation rules are written in the beans. The return String of the method, may return the location of the file relatively to WebContent folder.

EDIT: Please note, that it may appear also in faces-config.xml file, though is not recommended.

Look where you have declared it, (usually in the bean file that redirects to it) and change it to return "/secure/selectRole"

For example:

Public class myBean{
  public String save(){
    return "/secure/selectRole";
   }
}

Another place where I can think of, is in another .xhtml file - where in h:link you link to this page.