before asking, please understand that my english is not good.
I'm using Class.forName(...)
class in a servlet programming. when I access the servlet, I get a row of detailed controller information from Database indicating which controller to use.
This is Class.forName(...)
I coded:
Class c = Class.forName(row.getControllerInfo);
c.newInstance();
This works fine, but there's a problem, i'm using Eclipse. The problem is that when I modified the Controller file, the changed contents were not applied to the server.,,.
Probably the easiest way is not to support dynamic loading. Much better to achieve something like dynamic update by supporting multiple servers. For development, you could get around redeploy delays by using JRebel (there might be others).
If you really do want dynamic loading of classes then the answer is "class loaders". I suggest having a look at those, and come back with any specific questions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With