Skip to content

Commit

Permalink
Support JSF validation messages customizations #179
Browse files Browse the repository at this point in the history
  • Loading branch information
yurem committed Feb 7, 2020
1 parent 22ba5c2 commit 8355c89
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ public ExtendedResourceBundle(String baseName, Path externalResource, Properties
this.properties = properties;

this.lastUpdate = new Date();
this.watcher = externalResource.register(FileSystems.getDefault().newWatchService(), StandardWatchEventKinds.ENTRY_MODIFY);

Path baseFolder = externalResource.getParent();
this.watcher = baseFolder.register(FileSystems.getDefault().newWatchService(), StandardWatchEventKinds.ENTRY_MODIFY);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,14 @@ public class ExtendedResourceBundleControlProvider implements ResourceBundleCont
}

public ResourceBundle.Control getControl(String baseName) {
if (baseName.startsWith("com.sun") || baseName.startsWith("org.apache")) {
// System.out.println("Using default control to load bundle with baseName: " + baseName);
return null;
}
if (baseName.equals("javax.faces.Messages")) {
System.out.println("Preparing control to load bundle with baseName: " + baseName);
return new CustomControl();
}

System.out.println("Preparing control to load bundle with baseName: " + baseName);
// System.out.println("Using default control to load bundle with baseName: " + baseName);

// return null;
return new CustomControl();
return null;
}

protected static class CustomControl extends Control {
Expand Down

0 comments on commit 8355c89

Please sign in to comment.