In 4.0.1, JspC commandline tool is not making package names that correspond to
subdirectories in my context directory (i.e. I need
"/help/testhelp.jsp" to become "help/testhelp.java" and be "package help;"). There is
a setOutputInDirs method on the
CommandLineContext that seems like it should toggle this feature. I think I'm
patching this in the right place... I don't know for
sure that setOutputInDirs is the correct attribute to "piggy back" on, but regardless
I think other people may find this capability
useful.
Thanks a lot
Mike Schrag
--- JspC.java.orig Mon Feb 4 14:24:29 2002
+++ JspC.java Mon Feb 4 14:51:38 2002
@@ -346,6 +346,30 @@
if (dirset) {
clctxt.setOutputInDirs(true);
}
+
+ if (dirset) {
+ String packageName = null;
+ StringBuffer packageNameStrBuf = new StringBuffer();
+ if (targetPackage != null) {
+ packageNameStrBuf.append(targetPackage);
+ }
+
+ java.util.StringTokenizer packageTokenizer = new
+java.util.StringTokenizer(file.toString(), File.separator);
+ while (packageTokenizer.hasMoreTokens()) {
+ String token = packageTokenizer.nextToken();
+ if (packageTokenizer.hasMoreElements()) {
+ if (packageNameStrBuf.length() > 0) {
+ packageNameStrBuf.append(".");
+ }
+ packageNameStrBuf.append(token);
+ }
+ }
+ if (packageNameStrBuf.length() > 0) {
+ packageName = packageNameStrBuf.toString();
+ }
+ clctxt.setServletPackageName(packageName);
+ }
+
ArrayList urls = new ArrayList();
if (new File(clctxt.getRealPath("/")).exists()) {
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>