Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 42681 invoked from network); 21 Aug 2002 16:05:45 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 21 Aug 2002 16:05:45 -0000 Received: (qmail 13571 invoked by uid 97); 21 Aug 2002 16:06:07 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@jakarta.apache.org Received: (qmail 13481 invoked by uid 97); 21 Aug 2002 16:06:07 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 13382 invoked by uid 98); 21 Aug 2002 16:06:06 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) From: "John Trollinger" To: Subject: [patch] jasper2 4.1.9 - fixed the JspC to generate the class files in the right directory structure (bug 11891) Date: Wed, 21 Aug 2002 12:10:29 -0400 Message-ID: <000101c2492d$451e8820$220410ac@jtrollingerxp> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0002_01C2490B.BE0CE820" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------=_NextPart_000_0002_01C2490B.BE0CE820 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit This patch also changes the class file name stuff to eliminate unnecessary char escaping. ------=_NextPart_000_0002_01C2490B.BE0CE820 Content-Type: text/plain; name="jspcompilationcontextpatch.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="jspcompilationcontextpatch.txt" --- old/JspCompilationContext.java 2002-08-21 08:55:23.000000000 -0400=0A= +++ new/JspCompilationContext.java 2002-08-21 08:35:26.000000000 -0400=0A= @@ -267,7 +267,7 @@=0A= } for (int i =3D iSep; i < iEnd; i++) { char ch =3D jspUri.charAt(i); - if (Character.isLetterOrDigit(ch)) { + if (Character.isJavaIdentifierPart(ch)) { modifiedClassName.append(ch); } else if (ch =3D=3D '.') { modifiedClassName.append('_'); ------=_NextPart_000_0002_01C2490B.BE0CE820 Content-Type: text/plain; name="jspcpatch.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="jspcpatch.txt" --- old/JspC.java 2002-08-21 08:55:31.000000000 -0400=0A= +++ new/JspC.java 2002-08-21 09:19:51.000000000 -0400=0A= @@ -131,6 +131,8 @@=0A= public static final String SWITCH_WEBAPP_XML =3D "-webxml"; public static final String SWITCH_MAPPED =3D "-mapped"; public static final String SWITCH_DIE =3D "-die"; + public static final String SHOW_SUCCESS =3D"-s"; + public static final String LIST_ERRORS =3D "-l"; =20 public static final int NO_WEBXML =3D 0; public static final int INC_WEBXML =3D 10; @@ -196,6 +198,9 @@=0A= */ private TldLocationsCache tldLocationsCache =3D null; =20 + private boolean listErrors =3D false; + private boolean showSuccess =3D false; + public boolean getKeepGenerated() { // isn't this why we are running jspc? return true; @@ -386,11 +391,11 @@=0A= if (dirset) { int indexOfSlash =3D clctxt.getJspFile().lastIndexOf('/'); =20 - String pathName =3D ""; + /* String pathName =3D ""; if (indexOfSlash !=3D -1) { pathName =3D clctxt.getJspFile().substring(0, = indexOfSlash); - } - String tmpDir =3D outputDir + File.separatorChar + = pathName; + }*/ + String tmpDir =3D outputDir + File.separatorChar; // + = pathName; File f =3D new File(tmpDir); if (!f.exists()) { f.mkdirs(); @@ -519,6 +524,8 @@=0A= { try { String jspUri=3Dfile.replace('\\','/'); + String baseDir =3D scratchDir.getCanonicalPath(); + this.setOutputDir( baseDir + jspUri.substring( 0, = jspUri.lastIndexOf( '/' ) ) ); JspCompilationContext clctxt =3D new JspCompilationContext ( jspUri, false, this, context, null, null ); =20 @@ -540,6 +547,7 @@=0A= clctxt.setClassPath(classPath); =20 Compiler clc =3D clctxt.createCompiler(); + this.setOutputDir( baseDir ); =20 if( compile ) { // Generate both .class and .java @@ -556,7 +564,9 @@=0A= =20 // Generate mapping generateWebMapping( file, clctxt ); - + if ( showSuccess ) { + log.println( "Built File: " + file ); + } return true; } catch (FileNotFoundException fne) { Constants.message("jspc.error.fileDoesNotExist", @@ -565,7 +575,10 @@=0A= } catch (Exception e) { Constants.message("jspc.error.generalException", new Object[] {file, e}, Logger.ERROR); - if (dieLevel !=3D NO_DIE_LEVEL) { + if ( listErrors ) { + log.println( "Error in File: " + file ); + return true; + } else if (dieLevel !=3D NO_DIE_LEVEL) { dieOnExit =3D true; } throw new JasperException( e ); @@ -873,6 +886,10 @@=0A= setUriroot( nextArg()); } else if (tok.equals(SWITCH_FILE_WEBAPP)) { setUriroot( nextArg()); + } else if ( tok.equals( SHOW_SUCCESS ) ) { + showSuccess =3D true; + } else if ( tok.equals( LIST_ERRORS ) ) { + listErrors =3D true; } else if (tok.equals(SWITCH_WEBAPP_INC)) { webxmlFile =3D nextArg(); if (webxmlFile !=3D null) { @@ -912,6 +929,13 @@=0A= =20 Constants.jasperLog.setVerbosityLevel(verbosityLevel); } + /** + * allows user to set where the log goes other than System.out + * @param log + */ + public static void setLog( PrintStream log ) { + JspC.log =3D log; + } =20 } =20 ------=_NextPart_000_0002_01C2490B.BE0CE820 Content-Type: text/plain; name="messagespatch.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="messagespatch.txt" --- old/messages.properties 2002-07-18 19:25:05.000000000 -0400=0A= +++ new/messages.properties 2002-08-21 08:43:37.000000000 -0400=0A= @@ -173,6 +173,8 @@=0A= \ -v[#] Verbose mode (optional number is level, default is = 2)\n\ \ -d Output Directory\n\ \ -dd Literal Output Directory. (package dirs will not be = made)\n\ +\ -l Outputs the name of the JSP page upon failure\n\ +\ -s Outputs the name of the JSP page upon success\n\ \ -p Name of target package\n\ \ -c Name of target class name\n\ \ (only applies to first JSP page)\n\ ------=_NextPart_000_0002_01C2490B.BE0CE820 Content-Type: text/plain; charset=us-ascii -- To unsubscribe, e-mail: For additional commands, e-mail: ------=_NextPart_000_0002_01C2490B.BE0CE820--