kinman 02/02/01 13:54:21 Modified: jasper/src/share/org/apache/jasper CommandLineContext.java Log: PR: 5471 Submitted by: [EMAIL PROTECTED] (Steve Downey) Revision Changes Path 1.8 +28 -4 jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/CommandLineContext.java Index: CommandLineContext.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/CommandLineContext.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- CommandLineContext.java 10 Dec 2001 17:43:16 -0000 1.7 +++ CommandLineContext.java 1 Feb 2002 21:54:21 -0000 1.8 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/CommandLineContext.java,v 1.7 2001/12/10 17:43:16 kinman Exp $ - * $Revision: 1.7 $ - * $Date: 2001/12/10 17:43:16 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/CommandLineContext.java,v 1.8 2002/02/01 21:54:21 kinman Exp $ + * $Revision: 1.8 $ + * $Date: 2002/02/01 21:54:21 $ * * ==================================================================== * @@ -216,7 +216,31 @@ * The package name for the generated class. */ public String getServletPackageName() { - return servletPackageName; + //get the path to the jsp file + int indexOfSlash = getJspFile().lastIndexOf('/'); + String pathName; + if (indexOfSlash != -1) { + pathName = getJspFile().substring(0, indexOfSlash); + } else { + pathName = "/"; + } + //Assemble the package name from the base package name speced on + //the command line and the package name derived from the path to + //the jsp file + String packageName = ""; + if (servletPackageName != null && !servletPackageName.equals("")) { + packageName = servletPackageName; + } + if (packageName.equals("")) { + packageName = pathName.replace('/', '.'); + } else { + packageName += pathName.replace('/', '.'); + } + //strip off any leading '.' in the package name + if (!packageName.equals("") && packageName.charAt(0) == '.') { + packageName = packageName.substring(1); + } + return packageName; } /**
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>