cvs commit: jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler BeanGenerator.java JspParseEventListener.java ParserXJspSaxHandler.java
pierred 00/12/09 21:56:44 Modified:jasper/src/share/org/apache/jasper Constants.java jasper/src/share/org/apache/jasper/compiler BeanGenerator.java JspParseEventListener.java ParserXJspSaxHandler.java Log: Take 2 on the default list of imports for JSP generated classes. Removed java.io.IOException, java.beans.Beans, and org.apache.jasper.Exception. All that's left is org.apache.jasper.runtime.*. That will be in take 3 (eventually :-)) [Thanks to Craig for "waking me up" on this...] Revision ChangesPath 1.6 +0 -3 jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/Constants.java Index: Constants.java === RCS file: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/Constants.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Constants.java2000/12/09 05:45:47 1.5 +++ Constants.java2000/12/10 05:56:43 1.6 @@ -95,10 +95,7 @@ "javax.servlet.http.*", "javax.servlet.jsp.*", "javax.servlet.jsp.tagext.*", - "java.io.IOException", - "java.beans.Beans", "org.apache.jasper.runtime.*", - "org.apache.jasper.JasperException" }; /** 1.4 +5 -5 jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/BeanGenerator.java Index: BeanGenerator.java === RCS file: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/BeanGenerator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- BeanGenerator.java2000/11/30 21:47:47 1.3 +++ BeanGenerator.java2000/12/10 05:56:43 1.4 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/BeanGenerator.java,v 1.3 2000/11/30 21:47:47 pierred Exp $ - * $Revision: 1.3 $ - * $Date: 2000/11/30 21:47:47 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/BeanGenerator.java,v 1.4 2000/12/10 05:56:43 pierred Exp $ + * $Revision: 1.4 $ + * $Date: 2000/12/10 05:56:43 $ * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights @@ -350,11 +350,11 @@ writer.pushIndent (); if (beanRT == false) writer.println(varname+" = ("+ convert + -") Beans.instantiate(this.getClass().getClassLoader(), "+ +") java.beans.Beans.instantiate(this.getClass().getClassLoader(), "+ writer.quoteString(clsname) +");"); else writer.println(varname+" = ("+ convert + -") Beans.instantiate(this.getClass().getClassLoader(), "+ +") java.beans.Beans.instantiate(this.getClass().getClassLoader(), "+ clsname +");"); writer.popIndent (); writer.println ("} catch (Exception exc) {"); 1.18 +5 -5 jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java Index: JspParseEventListener.java === RCS file: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- JspParseEventListener.java2000/12/09 00:36:10 1.17 +++ JspParseEventListener.java2000/12/10 05:56:43 1.18 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v 1.17 2000/12/09 00:36:10 pierred Exp $ - * $Revision: 1.17 $ - * $Date: 2000/12/09 00:36:10 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/JspParseEventListener.java,v 1.18 2000/12/10 05:56:43 pierred Exp $ + * $Revision: 1.18 $ + * $Date: 2000/12/10 05:56:43 $ * * * @@ -297,7 +297,7 @@ writer.println("private static boolean _jspx_inited = false;"); writer.println(); -writer.println("public final void _jspx_init() throws JasperException {"); +writer.println("public final void _jspx_init() throws org.apache.jasper.JasperException {"); writer.pushIndent(); generateAll(InitMethodPhase.class); writer.popIndent(); @@ -309,7 +309,7 @@ "HttpServletRequest request, "+ "HttpServletResponse response)"); - writer.println("throws IOException, ServletException {"); + writer.println("throws java.io.IOException,
Re: cvs commit: jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler BeanGenerator.java JspParseEventListener.java ParserXJspSaxHandler.java
[EMAIL PROTECTED] wrote: pierred 00/12/09 21:56:44 Modified:jasper/src/share/org/apache/jasper Constants.java jasper/src/share/org/apache/jasper/compiler BeanGenerator.java JspParseEventListener.java ParserXJspSaxHandler.java Log: Take 2 on the default list of imports for JSP generated classes. Removed java.io.IOException, java.beans.Beans, and org.apache.jasper.Exception. All that's left is org.apache.jasper.runtime.*. That will be in take 3 (eventually :-)) [Thanks to Craig for "waking me up" on this...] Sorry, but I don't see what difference this change make. You're not removing dependencies, just removing imports and replacing them with FQCNs in the code. Why? Hans -- Hans Bergsten [EMAIL PROTECTED] Gefion Software http://www.gefionsoftware.com Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com
Re: cvs commit: jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler BeanGenerator.java JspParseEventListener.java ParserXJspSaxHandler.java
Hans Bergsten wrote: [EMAIL PROTECTED] wrote: pierred 00/12/09 21:56:44 Modified:jasper/src/share/org/apache/jasper Constants.java jasper/src/share/org/apache/jasper/compiler BeanGenerator.java JspParseEventListener.java ParserXJspSaxHandler.java Log: Take 2 on the default list of imports for JSP generated classes. Removed java.io.IOException, java.beans.Beans, and org.apache.jasper.Exception. All that's left is org.apache.jasper.runtime.*. That will be in take 3 (eventually :-)) [Thanks to Craig for "waking me up" on this...] Sorry, but I don't see what difference this change make. You're not removing dependencies, just removing imports and replacing them with FQCNs in the code. Why? Agree. Does not make a difference besides having a shorter import list. [Craig had made a comment about "java.Beans.*", but in fact I was only importing java.beans.Beans.] Might be better to leave those in the import list to make the dependency clear. What do you think? -- Pierre Hans -- Hans Bergsten [EMAIL PROTECTED] Gefion Software http://www.gefionsoftware.com Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com
Re: cvs commit: jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler BeanGenerator.java JspParseEventListener.java ParserXJspSaxHandler.java
Hans Bergsten wrote: Pierre Delisle wrote: Hans Bergsten wrote: [EMAIL PROTECTED] wrote: pierred 00/12/09 21:56:44 Modified:jasper/src/share/org/apache/jasper Constants.java jasper/src/share/org/apache/jasper/compiler BeanGenerator.java JspParseEventListener.java ParserXJspSaxHandler.java Log: Take 2 on the default list of imports for JSP generated classes. Removed java.io.IOException, java.beans.Beans, and org.apache.jasper.Exception. All that's left is org.apache.jasper.runtime.*. That will be in take 3 (eventually :-)) [Thanks to Craig for "waking me up" on this...] Sorry, but I don't see what difference this change make. You're not removing dependencies, just removing imports and replacing them with FQCNs in the code. Why? Agree. Does not make a difference besides having a shorter import list. [Craig had made a comment about "java.Beans.*", but in fact I was only importing java.beans.Beans.] Might be better to leave those in the import list to make the dependency clear. What do you think? In general, I prefer imports for the reason you mention; it makes it easier to see all dependencies. In generated JSP compilation classes, the important thing is not to have other complete package imports than the ones in the spec, but FQCN imports can't hurt anything. So, yeah, I think it's better to keep imports like java.beans.Beans and org.apache.jasper.Exception. Actually, it could make a difference. Assuming tomcat puts the import 'java.beans.Beans' in all generated JSP servlet classes, then a developer using Tomcat can use 'Beans' in a scriptlet without having to worry about the import. However, when porting the JSP page to another engine, the compile could fail if the target JSP container uses a FQCN in the generated code rather than an import statement as tomcat does. Given this, it then makes sense to limit the import list to the 'default' one mentioned in the spec. Container specific FQCN imports are also OK, but anything else should not be part of the import list. Does that make sense? -- Pierre
Re: cvs commit: jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler BeanGenerator.java JspParseEventListener.java ParserXJspSaxHandler.java
Pierre Delisle wrote: Hans Bergsten wrote: [...] In general, I prefer imports for the reason you mention; it makes it easier to see all dependencies. In generated JSP compilation classes, the important thing is not to have other complete package imports than the ones in the spec, but FQCN imports can't hurt anything. So, yeah, I think it's better to keep imports like java.beans.Beans and org.apache.jasper.Exception. Actually, it could make a difference. Assuming tomcat puts the import 'java.beans.Beans' in all generated JSP servlet classes, then a developer using Tomcat can use 'Beans' in a scriptlet without having to worry about the import. However, when porting the JSP page to another engine, the compile could fail if the target JSP container uses a FQCN in the generated code rather than an import statement as tomcat does. Given this, it then makes sense to limit the import list to the 'default' one mentioned in the spec. Container specific FQCN imports are also OK, but anything else should not be part of the import list. Does that make sense? Yes, you're right, of course :-) Hans -- Hans Bergsten [EMAIL PROTECTED] Gefion Software http://www.gefionsoftware.com Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com