Do you need syntax highlighting or anything fancy like that? Most web browsers can display plain text files, like your source code. If you simply upload the files to your website and create links to them, then visitors can view your code just fine. In fact, I use these technique at my C++ website.
While researching parsers I found a free tool that converts Java to HTML with color coding. The bad news: I can't find it again! Another tool I can't find again put links to source code into JavaDoc. I thought that was very nice. Sorry I don't have links to these things, but hope you find them encouraging in your own search.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
The Java source loads just fine in IE on the computers here at school. It may have to do with file type settings on the viewers platform. I guess I assume that if a user can't view the code directly in the web browser, then they probably know how to save it to a local file and view it in a text editor.
Joined: Mar 20, 2001
I agree Layne it is no hardship to download the source and view in an editor - that worked. I also loaded some .java .jsp and .xml files into MS Word and saved as an HTML file and that produces excellent results - viewable in both IE and Netscape directly.
Joined: Jan 29, 2003
In Windows I have associated extension Java with my favorite text editor. Source files on my site are stored with extension Java and normal hyperlinks to them. When I click, the browser downloads a temp file and opens the text editor. The problem with this is that the next guy might have Java associated with nothing, or something odd and might get undesired results. The Java2HTML tools would be more reliable for the general public to look at your code.