About Java2Web

Warning - java2web is now obsolete. Please use its successor: code2web

What is it?

Java2Web is a set of utilities and classes that convert Java into HTML. Ok, what's different from the gazillion other similar tools?

I wrote Java2Web in a couple of days for my personal needs - publishing tutorials with source code on the web. A tutorial with source code is different from dumping your sorce on the web with some pretty styles. Some irrelevant parts of the code may need to be hidden. Some others - highlighted. Specific links at specific points must be inserted to other resources on the web - be them javadocs, other source files, or whatever. I might need to annotate a part of the code to illustrate a point.

So why don't use a standard Java 2 HTML converter and then perform the edits by hand? Well, because if there is one thing that I hate is the double-maintenance problem : having to remember - each time when I change a source code - that I must change something else somewhere in order to keep them in sync. So I needed a tool that would allow me to do all those things in one step without having to store the final result.

So Java2Web has currently the following features:

Here is an example of the generated output.

How can I use it?

If you are a developer wishing to generate HTML from Java on the fly, you can use the HTMLConverter class to handle the conversion and manipulate all options programmatically

If you are an end-user wishing to convert some java source code to HTML using a command-like program, you can use the included java2web program to perform the conversion. All options are set from the command line.

If you are a web designer wishing to convert on the fly java code to HTML and embed it in a pre-existing design, you can use the included JSP Tag . However, this requires a Servlet/JSP compatible server.

 

Acknowledgements

Java2Web was developed using the excellent JavaCC parser-generator. For the full docs see the usage.