WebWork2 contains ftl and js files inside the webwork JAR and these two types of files make up a template for a theme. Anyways, customizing the ftl files is covered in the wiki but making custom js files is not covered. I figured out how to do this though by walking through the WebWork2 filter code. Here’s the quick solution:
If the the resource is (for example)
/webwork/ajax/validation.js
place your custom version into
WEB-INF/classes/template/ajax/validation.js
Really quick, here’s why. WebWork is lopping off the /webwork part of the URI and then adding a bunch of different prefixes until it finds the resource in the classpath (using ClassLoader.getResourceAsStream). The first one is some crazy package name like com/opensymphony/webwork or something. The next one is just template. Therefore, placing just about any static resource like JavaScript files in the WEB-INF/classes/template directory will allow WebWork to locate them.
Thanks, in my installation the server cannot find some static files. this may be a workaround….
LikeLike