People, thanks a lot of helping.
Looking (and debugging) I can confirm your ideas.
A main in a 'servlet' is just executable from the command line.
The reason of my example fails is that using the source as
a servlet all initialization are done. But not if I call
the main. I get a NullPointerException, due to a
HtmlFactory not initialized. And that was the reason I stuck.
Either it is a flaw in the code, or eventually there is the possibility to get necessary initialization done by commandline parameter forcing the JVM to look at the server or ...
At least I saw commandlines (only a scetch not exact) like this
java -D....Factory=java.... MyJavaCode.
My problem is solved
, so thanks again!