I am using Apache Wicket as my webapp framework and I have a following structure:
What I need:
1) The javascript file Rules.js should be loaded and readable for my Custom Java Class Process.java. Because in my Process.java I have something like this:
private String readFile(String filename) throws IOException {
File file = new File("PATH");
//reads the file and returns a string
...
}
So the first question would be: What path instead of "PATH" should I use, when my resource Rules.js is in the resource folder or any other package folder?
2) The Process.java not only reads the file, it also manipulates my Rules.js file for example with json. So the following line should be added to the Rules.js file:
var object = {JSON STRING};
I know how to do this already.
3) After the manipulation of the Rules.js file it should automatically be updated of course. So the second question would be: What else should I add and where to my application so the Rules.js is a file that is aviable for all needed classes in my application and is always up to date during the session.
I tried a lot of things already, but I am missing here something that I cant figure out...