Thanks to everyone who helped me get this far. Here is what I did to get the examples to run without Java:
- Unpack the sources
- cd zcs/Ajax
- ant war # this puts some generated files into build/WebRoot
- yes no | cp -ri WebRoot/js build/WebRoot/ # copy non generated files
- Add a link so that a URL starting with /ajax points to your build/WebRoot dir:
- If you are using Apache, add something like this to your config: Alias /ajax/ <path to zcs>/Ajax/build/WebRoot/
- If you want to use file: urls, you can add a symlink to your filesystem root: ln -s <path to zcs>/Ajax/build/WebRoot /ajax
- In each example directory, run jsp2html.pl on the .jsp file to generate non-JSP HTML. For example: ( cd build/WebRoot/examples/tree/; jsp2html.pl TreeExample.jsp > index.html )
Here is my jsp2html.pl. Pretty ugly, but it works for these simple examples:
Code:
#!/usr/bin/perl -w
use strict;
sub process
{
my ( $fname ) = @_;
my $fdata;
{
open F, $fname or die "Failed to open $fname: $!";
undef $/;
$fdata = <F>;
close F;
}
$fdata =~ s{<%= *contextPath *%>}{../..}g;
$fdata =~ s{<fmt:message key="DwtMsg"[^>]*>}{../../js/dwt/config/msgs/DwtMsg_en.js}g;
$fdata =~ s{<fmt:message key="AjxMsg"[^>]*>}{../../js/config/msgs/AjxMsg_en.js}g;
$fdata =~ s{<(%.*?%)>}{<!--$1-->}sg;
$fdata =~ s{<jsp:include *page="([^"]*)" */>}{ process( $1 ) }ge;
return "<!-- BEGIN $fname ($0) -->\n$fdata\n<!-- END $fname -->\n";
}
print process( $ARGV[0] )