tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources messages.properties
Date Tue, 08 Jul 2003 22:53:38 GMT
remm        2003/07/08 15:53:38

  Modified:    jasper2/src/share/org/apache/jasper/compiler
                        DefaultErrorHandler.java
               jasper2/src/share/org/apache/jasper/resources
                        messages.properties
  Log:
  - Add decent error message when JAVAC isn't found (I think this was a frequent
    RFE).
  
  Revision  Changes    Path
  1.7       +22 -14    jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/DefaultErrorHandler.java
  
  Index: DefaultErrorHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/DefaultErrorHandler.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DefaultErrorHandler.java	22 Jan 2003 20:08:24 -0000	1.6
  +++ DefaultErrorHandler.java	8 Jul 2003 22:53:38 -0000	1.7
  @@ -105,17 +105,25 @@
   	Object[] args = null;
           StringBuffer buf = new StringBuffer();
   	
  -	for (int i=0; i<details.length; i++) {
  -	    args = new Object[] {
  -		new Integer(details[i].getJspBeginLineNumber()), 
  -		details[i].getJspFileName()
  -	    };
  -	    buf.append(Localizer.getMessage("jsp.error.single.line.number",
  -					   args));
  -	    buf.append(Localizer.getMessage("jsp.error.corresponding.servlet"));
  -	    buf.append(details[i].getErrorMessage());
  -	    buf.append('\n');
  -	}
  +        if ((details.length == 1) 
  +            && (details[0].getJspBeginLineNumber() == -1)
  +            && (details[0].getJspFileName() == null)) {
  +            // Special case: No Java compiler found
  +            buf.append(Localizer.getMessage("jsp.error.nojavac"));
  +            buf.append('\n');
  +        } else {
  +            for (int i=0; i < details.length; i++) {
  +                args = new Object[] {
  +                    new Integer(details[i].getJspBeginLineNumber()), 
  +                    details[i].getJspFileName()
  +                };
  +                buf.append(Localizer.getMessage("jsp.error.single.line.number",
  +                                                args));
  +                buf.append(Localizer.getMessage("jsp.error.corresponding.servlet"));
  +                buf.append(details[i].getErrorMessage());
  +                buf.append('\n');
  +            }
  +        }
   
   	throw new JasperException(Localizer.getMessage("jsp.error.unable.compile")
   				  + buf);
  
  
  
  1.120     +5 -1      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages.properties
  
  Index: messages.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/resources/messages.properties,v
  retrieving revision 1.119
  retrieving revision 1.120
  diff -u -r1.119 -r1.120
  --- messages.properties	6 Jul 2003 22:56:54 -0000	1.119
  +++ messages.properties	8 Jul 2003 22:53:38 -0000	1.120
  @@ -11,6 +11,10 @@
   jsp.message.scratch.dir.is=Scratch dir for the JSP engine is: {0}
   jsp.message.parent_class_loader_is=Parent class loader is: {0}
   jsp.message.dont.modify.servlets=IMPORTANT: Do not modify the generated servlets
  +jsp.error.nojavac=\n\nNo Java compiler was found to compile the generated source for the
JSP. \
  +\nThis can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK
\
  +\nto the common/lib directory of the Tomcat server, followed by a Tomcat restart. \
  +\nIf using an alternate Java compiler, please check its installation and access path.
   jsp.error.not.impl.comments=Internal error: Comments not implemented
   jsp.error.not.impl.directives=Internal error: Directives not implemented
   jsp.error.not.impl.declarations=Internal error: Declarations not implemented
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message