views:

66

answers:

1

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?

A: 

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.

Odelya
Thank you for the response. The trick is that I have not yet called anything in a bean. The first thing that happends is that I redirect the request to a xhtmlpage in a servletfilter. I have changed the URL there. What loads the externat context. It seams to skip loading the subfolder.
Stefan