- The JRuby community is pleased to announce the release of JRuby 1.1 RC 1 – JRuby – Codehaus – JRuby 1.1RC1 is the first release candidate of JRuby 1.1. JRuby 1.1 represents a concerted focus on speed and refinement. Ruby code can completely compile in an Ahead Of Time (AOT) or Just In Time (JIT) mode; yielding a faster Ruby
- Raible Designs | FreeMarker vs. JSP 2 – I’ve been doing quite a bit of prototyping with Spring MVC and Struts 2 with both JSP and FreeMarker in the last few months.
- Mastering Grails: Build your first Grails application – Grails gives you the development experience of Rails while being firmly grounded in proven Java technologies. But Grails isn’t just a simple “me too” port of Rails to the Java. Grails takes the lessons learned from Rails and mixes them with Java.
- Software Secret Weapons: Lessons learned while moving from JSPWiki to WordPress – Last weekend I decided to move Software Secret Weapons web site from Java onto LAMP! It was a complete success that I want to share with you
- Dave Woods – HTML, CSS, Web Design » IE6 – CSS Bugs and Fixes Explained – In this article, I?ll hopefully cover the main problems that developers experience with Internet Explorer 6 and explain the solutions for these bugs.
- Firefox DataAnalytics Help center – DataAnalytics is a Firefox extension that enables importation, manipulation, analysis and graphing of data. Often websites lock their information in static tables. Have you ever wanted to sort or manipulate a product list sorted by name by price?
- Anyterm – SSH via web – Have you ever wanted SSH or telnet access to your system from an internet desert – from behind a strict firewall, from an internet cafe, or even from a mobile phone? Anyterm is a combination of a web page and a web server module that provides this access
- Understanding the Java Persistence API, Part 1 – Java World – In this article, you will see how elegantly data persistence can be handled in an object-oriented manner just with the help of JPA annotations.
- Sun To Acquire MySQL – Anyone who follows this blog or has heard my talks will have seen me say “Data is the Intel Inside” of the next generation of internet applications, the very heart of Web 2.0
- Sun buys MySQL for $1 billion to take centerstage in the web economy | The Open Road – The Business and Politics of Open Source by Matt Asay – CNET Blogs – An acquisition by Sun means that MySQL gets to continue being a pureplay open-source company and won’t need to sacrifice the ideals or the benefits of open source to suit a halfway (and half-baked) stance on open source.
- Open Source Unleashed: Book Review: JasperReports for Java Developers – “JasperReports for Java Developers” proved to be a well put together title that provided sufficient support for a JasperReports newbie, like me, while also making good as a source of reference content that might be useful for non-beginners
- GWT vs. FLEX – This article would compare Google GWT (Google Web Toolkit) and Adobe Flex 2 and would describe the advantages and disadvantages of each of these technologies.
- The Forrester Wave: Application Server Platforms, Q3 2007 by John R. Rymer – Forrester Research – Sun Microsystems revealed itself to be a Strong Performer, approaching the status of established player BEA Systems in that regard
Tag Archives: jspwiki
Java2HTML does XHTML – And it validates!
I’ve been using the Java2HTML library for a while now and it’s been doing a great job in my usage as an Ant task. I discovered Markus Gebhard’s Java2HTML library a few years back and have been very happy with it. Markus has done a great job in creating this open source library that converts Java (and other) source code (complete files or snippets) to HTML, RTF, TeX and XHTML with syntax highlighting. Out of the box, Java2HTML provides a CLI interface, GUI client, Ant task, Eclipse plugin and a JSPWiki plugin.
I downloaded the latest version as I was looking for something that would allow me to create valid XHTML with CSS and I have been very impressed with the quality of this library. In addition to all the stuff that comes out of the box, you can use Java2HTML programmatically to take Java, XML or any other piece of code and output XHTML. Here’s a snippet of code that takes a String of code and output a XHTML document.
[source:java]public static void main(String[] args) throws IOException {
String code = “… java code ….”;
JavaSourceConversionOptions options = JavaSourceConversionOptions.getDefault();
options.setShowFileName(false);
options.setShowLineNumbers(false);
JavaSourceStyleTable style = JavaSourceStyleTable.getDefaultEclipseStyleTable();
options.setStyleTable(style);
JavaSourceParser parser = new JavaSourceParser(options);
JavaSource javaCode = parser.parse(code);
JavaSource2Xhtml11Converter conveter = new JavaSource2Xhtml11Converter();
String header = conveter.getDocumentHeader(options, “Java2HTML now does XHTML”);
String footer = conveter.getDocumentFooter(options);
StringWriter sr = new StringWriter();
sr.write(header);
conveter.convert(javaCode, options, sr);
sr.write(footer);
System.out.println(“sr.getBuffer().toString() = ” + sr.getBuffer().toString());
}
[/source]
The snippet has been edited for brevity but you can see the complete class here, rendered out as an XHTML document. Here’s a link to W3C’s validator.