Hello everyone,
I'm using VelocityView and am very happy it's much easier creating
dynamic HTML than JSP and custom tags.
Now I need to use some my own implementation of ServletToolboxRuleSet
(which is in "org.apache.velocity.tools.view.servlet" package),
so I tried to extend ServletToolboxManager to overrride "getRuleSet()"
method in it. But I couldn't because ServletToolboxManager is singleton
and its only constructor is private.
ServletToolboxManager source (VelocityTools 1.1) is like this:
===
public class ServletToolboxManger extends XMLToolboxManager {
...
private ServletToolboxManager(ServletContext servletContext) {
...
}
...
public static synchronized ServletToolboxManager getInstance(
ServletContext servlet,
String toolboxFile) {
...
}
...
protected RuleSet getRuleSet() { ... }
}
===
and I made subclass like this (it's bad solution. it fails to compile...):
===
public class MyServletToolboxManger extends ServletToolboxManager {
public static synchronized ServletToolboxManger getInstance(
ServletContext servlet,
String toolboxFile) {
...
}
protected RuleSet getRuleSet() { /* return my own RuleSet */ }
}
===
If any good idea to extend ServletToolboxManager, please could you
tell me?
Thank you.
Sato
(*
* SATO TADAYOSI <[EMAIL PROTECTED]>
*)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]