Very nice. Can you specify the options in the jspwiki.properties file (or similar)? It would be nice to set the defaults without having to specify it for every bit of code. -- KieronWilkinson
- Not a bad idea, too. But already having the security properties I would suggest to use a special/own properties file for this plugin. I my feeling, no plugin should pollute the original JSPWiki properties file. --TomZ
I think a property file containing default options is not only useful for the plugin, but also for the whole Java2Html library. So I will try to provide a generic solution. But this will now have to wait for a few days or weeks. Meanwhile any kind of input is welcome. Also, are there any options missing? --MarkusGebhard
- Well, if you are planning to add options anyway :) I would actually quite like to be able to specify custom sytles, i.e. being able to set the colour of each type of syntax myself. But if it is a lot of work then don't bother... unless other people want that too anyway.' --KieronWilkinson
Ok, I have finished support for a properties file. An updated version of the plugin is attached to this page.
The default options of the Java2Html library can be defined in an optional property file java2html.properties. I have uploaded a file containing all the default options
. Note that all properties in the file are optional, so you can remove/comment out any property you don't want to modify.
Of course the properties file must be located on the classpath. With Tomcat and the JSPWiki plugin this can be done by adding the file to the installed java2html.jar. Is there a better way? I have not yet found out how the classpath for Tomcat and the JSPWiki plugins is defined...
- Fantastic! Well done!
- About the classpath, yes, it does seem to be a bit ill-defined to me. According to this page
(see Standard Directory Layout) you should be able to put in the lib or classes directory and it will be picked up, but it seems putting it in the lib directory doesn't work (at least for me). However, if you create a classes directory, e.g. "tomcat/jspwiki/WEB-INF/classes", and put it in there, it should be picked up no problem.
- One very minor thing I just noticed when I made an typo in the config file (a value 1281 as one of the colour byte values) was that there were no error produced, just the config being reverted back to the default. No huge problem, but it made be doubt my classpath solution above was working for a moment. ;)--KieronWilkinson
Thanks for the hint about the classpath. The classes folder is much more convenient than modifying the jar file.
The new Version 4.0
of the plugin now also rethrows the Illegal Configuration Exception as Plugin Exception. So you will see a detailed error
description on the JSPWiki page in case there is a typo in the config file.
Add new attachment
List of attachments
| Kind | Attachment Name | Size | Version | Date Modified | Author | Change note |
|---|---|---|---|---|---|---|
jar |
java2html.jar | 145.0 kB | 1 | 02-Jan-2004 23:13 | MarkusGebhard |