[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index] [Home]

Preprocessing with M4


I've added a dirty patch to preprocess .jsp files with m4 before
generating the java code. I will probably use this to make gnujsp
coexist with generation of static html files, sharing the M4 styling
macros. Is there interest in this? Should this feature be properly
implemented and added to the main codebase..? who knows...

--- /home/nick/soft/gnujsp-0.9.8/src/org/gjt/jsp/JSPCompiler.java
Mon Mar 22 15:03:03 1999
+++ JSPCompiler.java    Fri Feb 12 05:50:08 1999
@@ -149,7 +149,7 @@
		dependencies.addElement(jspFile);
		dependencies.addElement(new
Long(jspFile.lastModified()));
		try {
-			in = new BufferedReader(new
FileReader(jspFile));
+			in = new BufferedReader(new
InputStreamReader(Runtime.getRuntime().exec("m4 " +
jspFile).getInputStream()));
			try {
				srcBuf = new StringBuffer((int)
jspFile.length());
				while((s = in.readLine()) != null) {