How to get handle to a resource within a JSF class?
问题 I've put a properties file within src/main/resources in my JSF project. How do I get a handle to it? I understand that EL doesn't work within a backing bean. Note: The file is in src/main/resources - NOT src/main/webapps/resources , so the following doesn't work: FacesContext context = FacesContext.getCurrentInstance(); File value = context.getApplication().evaluateExpressionGet(context, "#{resource['resources:email.properties']}", File.class); 回答1: It's thus in the classpath. You can just