cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
remm2005/04/05 16:14:43 Modified:jasper2/src/share/org/apache/jasper/compiler DefaultErrorHandler.java TagFileProcessor.java Generator.java jasper2/src/share/org/apache/jasper/runtime JspSourceDependent.java jasper2/src/share/org/apache/jasper EmbeddedServletOptions.java jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: - Use ArrayList instead of Vector. - Add ugly hack until I find the cause of the issue with JDT and the source dependent interface. Functionally, the hack on the type obviously does not change anything. Revision ChangesPath 1.13 +22 -23 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.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- DefaultErrorHandler.java 25 May 2004 21:27:55 - 1.12 +++ DefaultErrorHandler.java 5 Apr 2005 23:14:43 - 1.13 @@ -24,7 +24,7 @@ * @author Jan Luehe */ class DefaultErrorHandler implements ErrorHandler { - + /* * Processes the given JSP parse error. * @@ -35,11 +35,11 @@ * @param exception Parse exception */ public void jspError(String fname, int line, int column, String errMsg, - Exception ex) throws JasperException { - throw new JasperException(fname + ( + line + , + column + ) - + + errMsg, ex); +Exception ex) throws JasperException { +throw new JasperException(fname + ( + line + , + column + ) ++ + errMsg, ex); } - + /* * Processes the given JSP parse error. * @@ -47,9 +47,9 @@ * @param exception Parse exception */ public void jspError(String errMsg, Exception ex) throws JasperException { - throw new JasperException(errMsg, ex); +throw new JasperException(errMsg, ex); } - + /* * Processes the given javac compilation errors. * @@ -57,34 +57,33 @@ * compilation errors */ public void javacError(JavacErrorDetail[] details) throws JasperException { - + if (details == null) { return; } - - Object[] args = null; + +Object[] args = null; StringBuffer buf = new StringBuffer(); - + for (int i=0; i details.length; i++) { if (details[i].getJspBeginLineNumber() = 0) { args = new Object[] { new Integer(details[i].getJspBeginLineNumber()), details[i].getJspFileName() }; buf.append(Localizer.getMessage(jsp.error.single.line.number, -args)); +args)); buf.append(\n); } - + buf.append( -Localizer.getMessage(jsp.error.corresponding.servlet)); +Localizer.getMessage(jsp.error.corresponding.servlet)); buf.append(details[i].getErrorMessage()); buf.append(\n\n); } - - throw new JasperException( -Localizer.getMessage(jsp.error.unable.compile) + \n\n + buf); + +throw new JasperException(Localizer.getMessage(jsp.error.unable.compile) + \n\n + buf); } - + /** * Processes the given javac error report and exception. * @@ -92,10 +91,10 @@ * @param exception Compilation exception */ public void javacError(String errorReport, Exception exception) -throws JasperException { - - throw new JasperException( -Localizer.getMessage(jsp.error.unable.compile), exception); +throws JasperException { + +throw new JasperException( +Localizer.getMessage(jsp.error.unable.compile), exception); } - + } 1.60 +2 -1 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagFileProcessor.java Index: TagFileProcessor.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagFileProcessor.java,v retrieving revision 1.59 retrieving revision 1.60 diff -u -r1.59 -r1.60 --- TagFileProcessor.java 12 May 2004 23:59:19 - 1.59 +++ TagFileProcessor.java
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
yoavs 2005/03/23 08:38:05 Modified:webapps/docs changelog.xml jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: Bugzilla 33219. Revision ChangesPath 1.254 +3 -0 jakarta-tomcat-catalina/webapps/docs/changelog.xml Index: changelog.xml === RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/changelog.xml,v retrieving revision 1.253 retrieving revision 1.254 diff -u -r1.253 -r1.254 --- changelog.xml 23 Mar 2005 16:31:41 - 1.253 +++ changelog.xml 23 Mar 2005 16:38:05 - 1.254 @@ -278,6 +278,9 @@ fix bug33539/bug: Better error message when an unknown element is encountered in the tag file. (yoavs) /fix + fix +bug33219/bug: Minor JspServletWrapper code cleanup. (yoavs) + /fix /changelog /subsection 1.40 +3 -6 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java Index: JspServletWrapper.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- JspServletWrapper.java21 Mar 2005 15:38:12 - 1.39 +++ JspServletWrapper.java23 Mar 2005 16:38:05 - 1.40 @@ -196,9 +196,7 @@ } if (options.getDevelopment() || firstTime ) { synchronized (this) { -if (firstTime) { -firstTime = false; -} +firstTime = false; ctxt.compile(); } } else { @@ -289,9 +287,8 @@ */ if (options.getDevelopment() || firstTime ) { synchronized (this) { -if (firstTime) { -firstTime = false; -} +firstTime = false; + // The following sets reload to true, if necessary ctxt.compile(); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
remm2004/07/07 09:28:58 Modified:jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: - Add an extra flag to make development mode (the default) faster, which could be useful (some are also dynamically generating JSPs). - Let me know if this causes problems. Revision ChangesPath 1.38 +14 -0 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java Index: JspServletWrapper.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- JspServletWrapper.java24 May 2004 21:33:48 - 1.37 +++ JspServletWrapper.java7 Jul 2004 16:28:58 - 1.38 @@ -75,6 +75,7 @@ private int tripCount; private JasperException compileException; private long servletClassLastModifiedTime; +private long lastModificationTest = 0L; /* * JspServletWrapper for JSP pages. @@ -379,4 +380,17 @@ } } +/** + * @return Returns the lastModificationTest. + */ +public long getLastModificationTest() { +return lastModificationTest; +} +/** + * @param lastModificationTest The lastModificationTest to set. + */ +public void setLastModificationTest(long lastModificationTest) { +this.lastModificationTest = lastModificationTest; +} + } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
luehe 2004/05/24 14:22:00 Modified:jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: - Added comments - Removed redundant if (reload) prior to calling getServlet() (reload flag is already being checked inside getServlet()) Revision ChangesPath 1.36 +14 -6 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java Index: JspServletWrapper.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- JspServletWrapper.java20 Apr 2004 00:05:09 - 1.35 +++ JspServletWrapper.java24 May 2004 21:22:00 - 1.36 @@ -157,7 +157,7 @@ return config.getServletContext(); } -/* +/** * Sets the compilation exception for this JspServletWrapper. * * @param je The compilation exception @@ -166,7 +166,6 @@ this.compileException = je; } - /** * Compile (if needed) and load a tag file */ @@ -266,28 +265,37 @@ Localizer.getMessage(jsp.error.unavailable)); } +/* + * (1) Compile + */ if (options.getDevelopment() || firstTime ) { synchronized (this) { if (firstTime) { firstTime = false; } +// The following sets reload to true, if necessary ctxt.compile(); } } else { if (compileException != null) { +// Throw cached compilation exception throw compileException; } } -if (reload) { -getServlet(); -} +/* + * (2) (Re)load servlet class file + */ +getServlet(); -// If a page is to only to be precompiled return. +// If a page is to be precompiled only, return. if (precompile) { return; } +/* + * (3) Service request + */ if (theServlet instanceof SingleThreadModel) { // sync on the wrapper so that the freshness // of the page is determined right before servicing - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
luehe 2004/05/24 14:33:48 Modified:jasper2/src/share/org/apache/jasper/compiler Compiler.java jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: Added support for JSP compilations in a clustered env, where one server instance may use JSPs compiled by another server instance. Assume a JSP named foo.jsp, along with these timestamps: t1= Timestamp of foo.jsp t2= Timestamp of foo.class SI_1 = ServerInstance_1 SI_2 = ServerInstance_2 Problem description: - Suppose SI_1 compiles foo.jsp and loads corresponding class file. - foo.jsp is subsequently modified and recompiled by SI_2. - SI_1 accesses foo.jsp: Since t2t1, it determines that no recompilation is necessary, and services the cached (outdated) class file With this commit, SI_1 will reload foo.class and service its updated contents. Revision ChangesPath 1.87 +3 -0 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java Index: Compiler.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v retrieving revision 1.86 retrieving revision 1.87 diff -u -r1.86 -r1.87 --- Compiler.java 21 May 2004 17:52:59 - 1.86 +++ Compiler.java 24 May 2004 21:33:48 - 1.87 @@ -543,6 +543,9 @@ outDated = true; } else { targetLastModified = targetFile.lastModified(); +if (checkClass) { +jsw.setServletClassLastModifiedTime(targetLastModified); +} if (targetLastModified jspRealLastModified) { if( log.isDebugEnabled() ) { log.debug(Compiler: outdated: + targetFile + + 1.37 +18 -0 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java Index: JspServletWrapper.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- JspServletWrapper.java24 May 2004 21:22:00 - 1.36 +++ JspServletWrapper.java24 May 2004 21:33:48 - 1.37 @@ -74,6 +74,7 @@ private boolean isTagFile; private int tripCount; private JasperException compileException; +private long servletClassLastModifiedTime; /* * JspServletWrapper for JSP pages. @@ -164,6 +165,23 @@ */ public void setCompilationException(JasperException je) { this.compileException = je; +} + +/** + * Sets the last-modified time of the servlet class file associated with + * this JspServletWrapper. + * + * @param lastModified Last-modified time of servlet class + */ +public void setServletClassLastModifiedTime(long lastModified) { +if (this.servletClassLastModifiedTime lastModified) { +synchronized (this) { +if (this.servletClassLastModifiedTime lastModified) { +this.servletClassLastModifiedTime = lastModified; +reload = true; +} +} +} } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
luehe 2004/04/19 17:05:09 Modified:jasper2/src/share/org/apache/jasper JspCompilationContext.java jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: When in deployment (ie., !development) mode, save any compilation exceptions and rethrow them (instead of recompiling and getting the same exception over and over again) until the next scheduled recompilation Revision ChangesPath 1.46 +7 -2 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java Index: JspCompilationContext.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- JspCompilationContext.java17 Mar 2004 19:23:03 - 1.45 +++ JspCompilationContext.java20 Apr 2004 00:05:09 - 1.46 @@ -506,12 +506,17 @@ try { jspCompiler.compile(); jsw.setReload(true); +jsw.setCompilationException(null); } catch (JasperException ex) { +jsw.setCompilationException(ex); throw ex; } catch (Exception ex) { ex.printStackTrace(); -throw new JasperException(Localizer.getMessage(jsp.error.unable.compile), - ex); +JasperException je = new JasperException( +Localizer.getMessage(jsp.error.unable.compile), +ex); +jsw.setCompilationException(je); +throw je; } } } 1.35 +27 -3 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java Index: JspServletWrapper.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- JspServletWrapper.java16 Apr 2004 23:01:29 - 1.34 +++ JspServletWrapper.java20 Apr 2004 00:05:09 - 1.35 @@ -73,6 +73,7 @@ private boolean reload = true; private boolean isTagFile; private int tripCount; +private JasperException compileException; /* * JspServletWrapper for JSP pages. @@ -143,8 +144,6 @@ if (!firstTime) { ctxt.getRuntimeContext().incrementJspReloadCount(); -} else { -firstTime = false; } reload = false; @@ -158,6 +157,16 @@ return config.getServletContext(); } +/* + * Sets the compilation exception for this JspServletWrapper. + * + * @param je The compilation exception + */ +public void setCompilationException(JasperException je) { +this.compileException = je; +} + + /** * Compile (if needed) and load a tag file */ @@ -169,9 +178,17 @@ } if (options.getDevelopment() || firstTime ) { synchronized (this) { +if (firstTime) { +firstTime = false; +} ctxt.compile(); } +} else { +if (compileException != null) { +throw compileException; +} } + if (reload) { tagHandlerClass = ctxt.load(); } @@ -249,9 +266,16 @@ Localizer.getMessage(jsp.error.unavailable)); } -if (options.getDevelopment() || firstTime ) { +if (options.getDevelopment() || firstTime ) { synchronized (this) { +if (firstTime) { +firstTime = false; +} ctxt.compile(); +} +} else { +if (compileException != null) { +throw compileException; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
markt 2004/04/14 12:21:29 Modified:jasper2/src/share/org/apache/jasper/servlet Tag: tomcat_4_branch JspServletWrapper.java Log: - Fix bug 19238. Don't wrap a ServletException in a JasperException. A custom exception in a JSP will be be wrapped in a ServletException. If this is further wrapped in a JasperException Tomcat can't get at the original exception and error page mappings in web.xml are not applied. Revision ChangesPath No revision No revision 1.6.2.7 +4 -4 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java Index: JspServletWrapper.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v retrieving revision 1.6.2.6 retrieving revision 1.6.2.7 diff -u -r1.6.2.6 -r1.6.2.7 --- JspServletWrapper.java9 Mar 2004 17:53:37 - 1.6.2.6 +++ JspServletWrapper.java14 Apr 2004 19:21:29 - 1.6.2.7 @@ -244,7 +244,7 @@ ex, Logger.ERROR); } } -} catch (JasperException ex) { +} catch (ServletException ex) { throw ex; } catch (Exception ex) { throw new JasperException(ex); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
kinman 2004/03/09 09:53:37 Modified:jasper2/src/share/org/apache/jasper/servlet Tag: tomcat_4_branch JspServletWrapper.java Log: - Patch by Torsten Fohrer Fix for bug 16113: removing then replacing a jsp page continues to give a 404 Revision ChangesPath No revision No revision 1.6.2.6 +4 -3 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java Index: JspServletWrapper.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v retrieving revision 1.6.2.5 retrieving revision 1.6.2.6 diff -u -r1.6.2.5 -r1.6.2.6 --- JspServletWrapper.java5 Feb 2004 22:19:08 - 1.6.2.5 +++ JspServletWrapper.java9 Mar 2004 17:53:37 - 1.6.2.6 @@ -225,6 +225,7 @@ ex.getMessage()); } } catch (FileNotFoundException ex) { +ctxt.incrementRemoved(); String includeRequestUri = (String) request.getAttribute(javax.servlet.include.request_uri); if (includeRequestUri != null) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
kinman 2004/03/08 16:47:10 Modified:jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: Patch by Torsten Fohrer [EMAIL PROTECTED] - Fix Bugzilla 16113: removing then replacing a jsp page continues to give a 404. Revision ChangesPath 1.32 +4 -3 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java Index: JspServletWrapper.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- JspServletWrapper.java2 Sep 2003 21:39:59 - 1.31 +++ JspServletWrapper.java9 Mar 2004 00:47:10 - 1.32 @@ -331,6 +331,7 @@ ex.getMessage()); } } catch (FileNotFoundException ex) { +ctxt.incrementRemoved(); String includeRequestUri = (String) request.getAttribute(javax.servlet.include.request_uri); if (includeRequestUri != null) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
glenn 2003/02/12 08:35:21 Modified:jasper2/src/share/org/apache/jasper Tag: tomcat_4_branch JspCompilationContext.java jasper2/src/share/org/apache/jasper/servlet Tag: tomcat_4_branch JspServletWrapper.java Log: Final fix for bug 16449 Revision ChangesPath No revision No revision 1.6.2.8 +3 -4 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java Index: JspCompilationContext.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java,v retrieving revision 1.6.2.7 retrieving revision 1.6.2.8 diff -u -r1.6.2.7 -r1.6.2.8 --- JspCompilationContext.java10 Feb 2003 16:29:52 - 1.6.2.7 +++ JspCompilationContext.java12 Feb 2003 16:35:20 - 1.6.2.8 @@ -504,7 +504,6 @@ (Constants.getString(jsp.error.unable.compile), ex); } removed = 0; -jsw.setReload(false); return servletClass; } No revision No revision 1.6.2.4 +4 -3 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java Index: JspServletWrapper.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v retrieving revision 1.6.2.3 retrieving revision 1.6.2.4 diff -u -r1.6.2.3 -r1.6.2.4 --- JspServletWrapper.java10 Feb 2003 16:29:52 - 1.6.2.3 +++ JspServletWrapper.java12 Feb 2003 16:35:21 - 1.6.2.4 @@ -157,6 +157,7 @@ theServlet.init(config); firstTime = false; +reload = false; } } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
glenn 2003/02/12 08:37:11 Modified:jasper2/src/share/org/apache/jasper JspCompilationContext.java jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: Final fix for bug 16449, ported from Tomcat 4 Revision ChangesPath 1.31 +3 -4 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java Index: JspCompilationContext.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- JspCompilationContext.java10 Feb 2003 16:38:59 - 1.30 +++ JspCompilationContext.java12 Feb 2003 16:37:11 - 1.31 @@ -609,7 +609,6 @@ ex); } removed = 0; -jsw.setReload(false); return servletClass; } 1.28 +4 -3 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java Index: JspServletWrapper.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- JspServletWrapper.java11 Feb 2003 21:43:59 - 1.27 +++ JspServletWrapper.java12 Feb 2003 16:37:11 - 1.28 @@ -196,6 +196,7 @@ theServlet.init(config); firstTime = false; +reload = false; } } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
luehe 2003/02/11 13:43:59 Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: Fixed 16727: Incorrect exception raised when tag file uses jsp:invoke to store result of fragment into session scope and calling page doesn't participate in a session. Revision ChangesPath 1.162 +5 -3 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java Index: Generator.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v retrieving revision 1.161 retrieving revision 1.162 diff -u -r1.161 -r1.162 --- Generator.java8 Feb 2003 00:06:40 - 1.161 +++ Generator.java11 Feb 2003 21:43:58 - 1.162 @@ -3132,6 +3132,8 @@ out.printil( throw (javax.servlet.jsp.SkipPageException) t; ); out.printil( if( t instanceof java.io.IOException ) ); out.printil( throw (java.io.IOException) t; ); +out.printil( if( t instanceof IllegalStateException ) ); +out.printil( throw (IllegalStateException) t; ); out.printil( if( t instanceof javax.servlet.jsp.JspException ) ); out.printil( throw (javax.servlet.jsp.JspException) t; ); out.printil(throw new javax.servlet.jsp.JspException(t); ); 1.42 +7 -7 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java Index: PageContextImpl.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- PageContextImpl.java 8 Feb 2003 00:59:31 - 1.41 +++ PageContextImpl.java 11 Feb 2003 21:43:58 - 1.42 @@ -283,7 +283,7 @@ case SESSION_SCOPE: if (session == null) { - throw new IllegalArgumentException( + throw new IllegalStateException( Localizer.getMessage(jsp.error.page.noSession)); } return session.getAttribute(name); @@ -326,7 +326,7 @@ case SESSION_SCOPE: if (session == null) { - throw new IllegalArgumentException( + throw new IllegalStateException( Localizer.getMessage(jsp.error.page.noSession)); } session.setAttribute(name, o); @@ -356,7 +356,7 @@ case SESSION_SCOPE: if (session == null) { - throw new IllegalArgumentException( + throw new IllegalStateException( Localizer.getMessage(jsp.error.page.noSession)); } session.removeAttribute(name); @@ -418,7 +418,7 @@ case SESSION_SCOPE: if (session == null) { - throw new IllegalArgumentException( + throw new IllegalStateException( Localizer.getMessage(jsp.error.page.noSession)); } return session.getAttributeNames(); 1.27 +5 -6 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java Index: JspServletWrapper.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- JspServletWrapper.java10 Feb 2003 16:38:59 - 1.26 +++ JspServletWrapper.java11 Feb 2003 21:43:59 - 1.27 @@ -363,9 +363,8 @@ throw ex; } catch (IOException ex) { throw ex; -// Jikes won't compile this ( JasperException extends ServletException -//} catch (JasperException ex) { -//throw ex; +} catch (IllegalStateException ex) { +throw ex; } catch (Exception ex) { throw new JasperException(ex); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
glenn 2003/02/10 08:29:52 Modified:jasper2/src/share/org/apache/jasper Tag: tomcat_4_branch JspCompilationContext.java jasper2/src/share/org/apache/jasper/servlet Tag: tomcat_4_branch JspServletWrapper.java Log: Fix bug 16449, JSP servlet reload thread locking double check bug. The locking mechanism was switched between the JspCompilationContext and the servlet/JspServletWrapper so that the JspServletWrapper can now check a boolean. The JspCompilationContext now calls jsw.setReload() to reset the reload flag, but that only happens within synchronized code. Revision ChangesPath No revision No revision 1.6.2.7 +6 -13 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java Index: JspCompilationContext.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java,v retrieving revision 1.6.2.6 retrieving revision 1.6.2.7 diff -u -r1.6.2.6 -r1.6.2.7 --- JspCompilationContext.java13 Sep 2002 19:01:18 - 1.6.2.6 +++ JspCompilationContext.java10 Feb 2003 16:29:52 - 1.6.2.7 @@ -113,8 +113,7 @@ protected JspRuntimeContext rctxt; protected int removed = 0; -protected boolean reload = true; - + protected URLClassLoader jspLoader; protected URL [] outUrls = new URL[1]; protected Class servletClass; @@ -472,7 +471,7 @@ if (jspCompiler.isOutDated()) { try { jspCompiler.compile(); -reload = true; +jsw.setReload(true); } catch (JasperException ex) { throw ex; } catch (Exception ex) { @@ -482,12 +481,6 @@ } } -/** True if the servlet needs loading - */ -public boolean isReload() { -return reload; -} - // Manipulating the class public Class load() @@ -511,7 +504,7 @@ (Constants.getString(jsp.error.unable.compile), ex); } removed = 0; -reload = false; +jsw.setReload(false); return servletClass; } No revision No revision 1.6.2.3 +11 -6 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java Index: JspServletWrapper.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v retrieving revision 1.6.2.2 retrieving revision 1.6.2.3 diff -u -r1.6.2.2 -r1.6.2.3 --- JspServletWrapper.java13 Sep 2002 19:01:19 - 1.6.2.2 +++ JspServletWrapper.java10 Feb 2003 16:29:52 - 1.6.2.3 @@ -111,6 +111,7 @@ private ServletConfig config; private Options options; private boolean firstTime = true; +private boolean reload = true; JspServletWrapper(ServletConfig config, Options options, String jspUri, boolean isErrorPage, JspRuntimeContext rctxt) @@ -130,14 +131,18 @@ return ctxt; } +public void setReload(boolean reload) { +this.reload = reload; +} + public Servlet getServlet() throws ServletException, IOException, FileNotFoundException { -if (ctxt.isReload()) { +if (reload) { synchronized (this) { // Synchronizing on jsw enables simultaneous loading // of different pages, but not the same page. -if (ctxt.isReload()) { +if (reload) { // This is to maintain the original protocol. destroy(); @@ -185,7 +190,7 @@ } } -if (ctxt.isReload()) { +if (reload) { getServlet(); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
glenn 2003/02/10 08:39:00 Modified:jasper2/src/share/org/apache/jasper JspCompilationContext.java jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: Port bug fix for 16449, thread locking from Tomcat 4 Revision ChangesPath 1.30 +6 -13 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java Index: JspCompilationContext.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- JspCompilationContext.java22 Jan 2003 20:08:23 - 1.29 +++ JspCompilationContext.java10 Feb 2003 16:38:59 - 1.30 @@ -115,8 +115,7 @@ private JspRuntimeContext rctxt; private int removed = 0; -private boolean reload = true; - + private URLClassLoader jspLoader; private URL[] outUrls; private Class servletClass; @@ -570,7 +569,7 @@ if (isPackagedTagFile || jspCompiler.isOutDated()) { try { jspCompiler.compile(); -reload = true; +jsw.setReload(true); } catch (JasperException ex) { throw ex; } catch (Exception ex) { @@ -581,12 +580,6 @@ } } -/** True if the servlet needs loading - */ -public boolean isReload() { -return reload; -} - // Manipulating the class public Class load() @@ -616,7 +609,7 @@ ex); } removed = 0; -reload = false; +jsw.setReload(false); return servletClass; } 1.26 +13 -8 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java Index: JspServletWrapper.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- JspServletWrapper.java22 Jan 2003 20:08:25 - 1.25 +++ JspServletWrapper.java10 Feb 2003 16:38:59 - 1.26 @@ -122,6 +122,7 @@ private ServletConfig config; private Options options; private boolean firstTime = true; +private boolean reload = true; private boolean isTagFile; private int tripCount; @@ -169,14 +170,18 @@ return ctxt; } +public void setReload(boolean reload) { +this.reload = reload; +} + public Servlet getServlet() throws ServletException, IOException, FileNotFoundException { -if (ctxt.isReload()) { +if (reload) { synchronized (this) { // Synchronizing on jsw enables simultaneous loading // of different pages, but not the same page. -if (ctxt.isReload()) { +if (reload) { // This is to maintain the original protocol. destroy(); @@ -215,7 +220,7 @@ ctxt.compile(); } } -if (ctxt.isReload()) { +if (reload) { tagHandlerClass = ctxt.load(); } } catch (FileNotFoundException ex) { @@ -248,7 +253,7 @@ try { Object target; if (isTagFile) { -if (ctxt.isReload()) { +if (reload) { tagHandlerClass = ctxt.load(); } target = tagHandlerClass.newInstance(); @@ -298,7 +303,7 @@ } } -if (ctxt.isReload()) { +if (reload) { getServlet(); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
luehe 2002/12/18 15:18:21 Modified:jasper2/src/share/org/apache/jasper JspCompilationContext.java jasper2/src/share/org/apache/jasper/compiler ImplicitTagLibraryInfo.java JspDocumentParser.java Parser.java ParserController.java TagFileProcessor.java TagLibraryInfoImpl.java jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: If a tag file is packaged in a JAR, any of its include directives must be resolved against the JAR as opposed to the filesystem. Revision ChangesPath 1.28 +24 -11 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java Index: JspCompilationContext.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- JspCompilationContext.java8 Dec 2002 13:42:52 - 1.27 +++ JspCompilationContext.java18 Dec 2002 23:18:20 - 1.28 @@ -64,6 +64,7 @@ import java.io.*; import java.net.*; import java.util.*; +import java.util.jar.JarFile; import javax.servlet.ServletContext; import javax.servlet.jsp.tagext.TagInfo; import javax.servlet.jsp.tagext.TagData; @@ -122,6 +123,7 @@ private boolean isTagFile; private boolean protoTypeMode; private TagInfo tagInfo; +private JarFile tagFileJar; // jspURI _must_ be relative to the context public JspCompilationContext(String jspUri, @@ -162,13 +164,12 @@ ServletContext context, JspServletWrapper jsw, JspRuntimeContext rctxt, - Hashtable tagFileJars) { - + JarFile tagFileJar) { this(tagfile, false, options, context, jsw, rctxt); this.isTagFile = true; this.tagInfo = tagInfo; - this.tagFileJars = tagFileJars; - if (tagFileJars != null tagFileJars.get(tagfile) != null) { + this.tagFileJar = tagFileJar; + if (tagFileJar != null) { isPackagedTagFile = true; } } @@ -284,13 +285,25 @@ } /** - * Returns the tag-file-to-JAR-file mapping for tag files packaged in JARs. + * Returns the tag-file-name-to-JAR-file map of this compilation unit, + * which maps tag file names to the JAR files in which the tag files are + * packaged. * - * The mapping uses the tag file name as the key, and the JAR file - * containing the tag file as the value. + * The map is populated when parsing the tag-file elements of the TLDs + * of any imported taglibs. */ public Hashtable getTagFileJars() { - return tagFileJars; + return this.tagFileJars; +} + +/** + * Returns the JAR file in which the tag file for which this + * JspCompilationContext was created is packaged, or null if this + * JspCompilationContext does not correspond to a tag file, or if the + * corresponding tag file is not packaged in a JAR. + */ +public JarFile getTagFileJar() { + return this.tagFileJar; } /* Common implementation */ 1.18 +7 -5 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java Index: ImplicitTagLibraryInfo.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- ImplicitTagLibraryInfo.java 14 Dec 2002 14:16:07 - 1.17 +++ ImplicitTagLibraryInfo.java 18 Dec 2002 23:18:20 - 1.18 @@ -159,8 +159,10 @@ TagInfo tagInfo = null; try { - tagInfo = TagFileProcessor.parseTagFile(pc, shortName, path, - this); + tagInfo = TagFileProcessor.parseTagFileDirectives(pc, + shortName, + path, + this); } catch (JasperException je) { throw new RuntimeException(je.toString()); } 1.34 +4 -4 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspDocumentParser.java Index: JspDocumentParser.java
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
glenn 2002/12/08 05:42:53 Modified:jasper2/src/share/org/apache/jasper EmbededServletOptions.java JspCompilationContext.java jasper2/src/share/org/apache/jasper/compiler Compiler.java JspRuntimeContext.java jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: Port bug fixes and minor changes I made to Tomcat 4 to Tomcat 5 where appropriate. Revision ChangesPath 1.15 +8 -5 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbededServletOptions.java Index: EmbededServletOptions.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbededServletOptions.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- EmbededServletOptions.java4 Dec 2002 00:48:42 - 1.14 +++ EmbededServletOptions.java8 Dec 2002 13:42:52 - 1.15 @@ -184,7 +184,7 @@ * Java platform encoding to generate the JSP * page servlet. */ -private String javaEncoding; +private String javaEncoding = UTF8; public String getProperty(String name ) { return settings.getProperty( name ); @@ -476,7 +476,10 @@ this.compiler = config.getInitParameter(compiler); -this.javaEncoding = config.getInitParameter(javaEncoding); +String javaEncoding = config.getInitParameter(javaEncoding); +if (javaEncoding != null) { +this.javaEncoding = javaEncoding; +} // Setup the global Tag Libraries location cache for this // web-application. 1.27 +3 -11 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java Index: JspCompilationContext.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- JspCompilationContext.java5 Dec 2002 02:27:35 - 1.26 +++ JspCompilationContext.java8 Dec 2002 13:42:52 - 1.27 @@ -579,9 +579,6 @@ throws JasperException, FileNotFoundException { try { -if (servletClass == null !options.getDevelopment()) { -compile(); -} jspLoader = new JasperLoader (outUrls, getServletPackageName() + . + getServletClassName(), @@ -597,14 +594,9 @@ getServletClassName(); } servletClass = jspLoader.loadClass(name); -} catch (FileNotFoundException ex) { -jspCompiler.removeGeneratedFiles(); -throw ex; } catch (ClassNotFoundException cex) { throw new JasperException( Constants.getString(jsp.error.unable.load),cex); -} catch (JasperException ex) { -throw ex; } catch (Exception ex) { throw new JasperException (Constants.getString(jsp.error.unable.compile), ex); 1.41 +36 -44 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java Index: Compiler.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- Compiler.java 5 Dec 2002 23:56:39 - 1.40 +++ Compiler.java 8 Dec 2002 13:42:53 - 1.41 @@ -120,6 +120,7 @@ private ErrorDispatcher errDispatcher; private PageInfo pageInfo; private JspServletWrapper jsw; +private JasperAntLogger logger; private TagFileProcessor tfp; protected Project project=null; @@ -148,20 +149,19 @@ // Initializing project project = new Project(); // XXX We should use a specialized logger to redirect to jasperlog -//DefaultLogger bl=new JasperAntLogger(); -DefaultLogger bl=new DefaultLogger(); -bl.setOutputPrintStream(System.err); -bl.setErrorPrintStream(System.err); +logger = new JasperAntLogger(); +logger.setOutputPrintStream(System.out); +logger.setErrorPrintStream(System.err); if( Constants.jasperLog.getVerbosityLevel() = Logger.DEBUG ) { -bl.setMessageOutputLevel( Project.MSG_VERBOSE ); +logger.setMessageOutputLevel( Project.MSG_VERBOSE ); } else { -
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
luehe 2002/12/04 18:27:35 Modified:jasper2/src/share/org/apache/jasper JspCompilationContext.java jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: Fix for 15002 (Tag files in different directories not belonging to different tag libraries) on Windows. Revision ChangesPath 1.26 +4 -4 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java Index: JspCompilationContext.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- JspCompilationContext.java28 Nov 2002 04:18:07 - 1.25 +++ JspCompilationContext.java5 Dec 2002 02:27:35 - 1.26 @@ -447,7 +447,7 @@ if (isTagFile) { jspPath = tags/ - + tagInfo.getTagClassName().replace('.', File.separatorChar) + + tagInfo.getTagClassName().replace('.', '/') + .java; } else { String dirName = getJspFile(); 1.22 +4 -4 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java Index: JspServletWrapper.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- JspServletWrapper.java28 Nov 2002 04:18:08 - 1.21 +++ JspServletWrapper.java5 Dec 2002 02:27:35 - 1.22 @@ -155,7 +155,7 @@ servletContext, this, rctxt, tagFileJars); ctxt.createOutdir(/tags/ - + tagInfo.getTagClassName().replace('.', File.separatorChar)); + + tagInfo.getTagClassName().replace('.', '/')); } public JspCompilationContext getJspEngineContext() { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
kinman 2002/09/11 12:07:33 Modified:jasper2/src/share/org/apache/jasper JspCompilationContext.java jasper2/src/share/org/apache/jasper/compiler Compiler.java Generator.java TagFileProcessor.java jasper2/src/share/org/apache/jasper/resources messages.properties jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: - Handle tag file compilations with circular dependencies. Approach taken: * Use a counter in JspServletWrapper for detection of circularities. * Generate a skeleton tag handler (which has no dependency) from TagInfo and use that to compile its clients. It is eventually replaced by the real one. Todo: The compilation of tag files is now serialized. Can be made more concurrent with more bookkeeping. Revision ChangesPath 1.21 +20 -3 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java Index: JspCompilationContext.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- JspCompilationContext.java6 Sep 2002 21:40:53 - 1.20 +++ JspCompilationContext.java11 Sep 2002 19:07:32 - 1.21 @@ -122,6 +122,7 @@ protected Class servletClass; protected boolean isTagFile; +protected boolean protoTypeMode; protected TagInfo tagInfo; protected TagData tagData; @@ -235,6 +236,10 @@ return jspCompiler; } +public Compiler getCompiler() { + return jspCompiler; +} + /** -- Access resources in the webapp -- */ /** @@ -361,6 +366,18 @@ public TagInfo getTagInfo() { return tagInfo; +} + +/** + * True if we are compiling a tag file in prototype mode, i.e. we only + * Generate codes with class for the tag handler with empty method bodies. + */ +public boolean isPrototypeMode() { + return protoTypeMode; +} + +public void setPrototypeMode(boolean pm) { + protoTypeMode = pm; } public TagData getTagData() { 1.32 +40 -3 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java Index: Compiler.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- Compiler.java 28 Aug 2002 23:00:18 - 1.31 +++ Compiler.java 11 Sep 2002 19:07:32 - 1.32 @@ -119,6 +119,7 @@ private ErrorDispatcher errDispatcher; private PageInfo pageInfo; private JspServletWrapper jsw; +private TagFileProcessor tfp; protected Project project=null; @@ -256,6 +257,13 @@ ParserController parserCtl = new ParserController(ctxt, this); pageNodes = parserCtl.parse(ctxt.getJspFile()); + if (ctxt.isPrototypeMode()) { + // generate prototype .java file for the tag file + Generator.generate(writer, this, pageNodes); +writer.close(); + return; + } + // Validate and process attributes Validator.validate(this, pageNodes); @@ -268,7 +276,8 @@ // Compile (if necessary) and load the tag files referenced in // this compilation unit. - TagFileProcessor.loadTagFiles(this, pageNodes); + tfp = new TagFileProcessor(); + tfp.loadTagFiles(this, pageNodes); long t3=System.currentTimeMillis(); @@ -287,6 +296,14 @@ //JSR45 Support - note this needs to be checked by a JSR45 guru SmapUtil.generateSmap(ctxt, pageNodes, true); + + // If any proto type .java and .class files was generated, + // the prototype .java may have been replaced by the current + // compilation (if the tag file is self referencing), but the + // .class file need to be removed, to make sure that javac would + // generate .class again from the new .java file just generated. + + tfp.removeProtoTypeFiles(ctxt.getClassFileName()); } /** @@ -368,6 +385,11 @@ if( t2-t1 500 ) { log.info( Compiled + javaFileName + + (t2-t1)); } + + if (ctxt.isPrototypeMode()) { + return; + } + //JSR45 Support - note this needs to be checked by a JSR45 guru SmapUtil.installSmap(ctxt); } @@ -380,6 +402,9 @@ { generateJava();
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
kinman 2002/09/09 13:36:07 Modified:jasper2/src/share/org/apache/jasper/compiler TagFileProcessor.java jasper2/src/share/org/apache/jasper/resources messages.properties jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: - Detect and flags circular dependent tag files. Revision ChangesPath 1.23 +21 -12 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagFileProcessor.java Index: TagFileProcessor.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagFileProcessor.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- TagFileProcessor.java 4 Sep 2002 17:59:11 - 1.22 +++ TagFileProcessor.java 9 Sep 2002 20:36:07 - 1.23 @@ -332,11 +332,12 @@ /** * Compiles and loads a tagfile. */ -private static Class loadTagFile(JspCompilationContext ctxt, +private static Class loadTagFile(Compiler compiler, String tagFilePath, TagInfo tagInfo, TagData tagData) throws JasperException { + JspCompilationContext ctxt = compiler.getCompilationContext(); JspRuntimeContext rctxt = ctxt.getRuntimeContext(); JspServletWrapper wrapper = (JspServletWrapper) rctxt.getWrapper(tagFilePath); @@ -353,7 +354,17 @@ ctxt.getTagFileJars()); rctxt.addWrapper(tagFilePath,wrapper); } - return wrapper.loadTagFile(); + + // Check to see if we have been here before but not finished + // compiling/loading. + if (wrapper.incTripCount() 0) { + // Circular tag file dependencies + compiler.getErrorDispatcher().jspError(jsp.error.circular.tagfile, + tagFilePath); + } + Class tagClass = wrapper.loadTagFile(); + wrapper.decTripCount(); + return tagClass; } /* @@ -363,12 +374,12 @@ static class TagFileLoaderVisitor extends Node.Visitor { - private JspCompilationContext ctxt; + private Compiler compiler; private PageInfo pageInfo; - TagFileLoaderVisitor(JspCompilationContext ctxt, PageInfo pageInfo) { - this.ctxt = ctxt; - this.pageInfo = pageInfo; + TagFileLoaderVisitor(Compiler compiler) { + this.compiler = compiler; + this.pageInfo = compiler.getPageInfo(); } public void visit(Node.CustomTag n) throws JasperException { @@ -376,7 +387,7 @@ if (tagFileInfo != null) { String tagFilePath = tagFileInfo.getPath(); pageInfo.addDependant(tagFilePath); - Class c = loadTagFile(ctxt, tagFilePath, n.getTagInfo(), + Class c = loadTagFile(compiler, tagFilePath, n.getTagInfo(), n.getTagData()); n.setTagHandlerClass(c); } @@ -393,9 +404,7 @@ public static void loadTagFiles(Compiler compiler, Node.Nodes page) throws JasperException { - JspCompilationContext ctxt = compiler.getCompilationContext(); - PageInfo pageInfo = compiler.getPageInfo(); - page.visit(new TagFileLoaderVisitor(ctxt, pageInfo)); + page.visit(new TagFileLoaderVisitor(compiler)); } } 1.36 +2 -2 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.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- messages.properties 29 Aug 2002 23:27:36 - 1.35 +++ messages.properties 9 Sep 2002 20:36:07 - 1.36 @@ -300,4 +300,4 @@ jsp.error.duplicate.name.jspattribute=The attribute {0} specified in the standard or custom action also appears as the value of the name attribute in the enclosed jsp:attribute jsp.error.not.in.template=Not allowed in a template text body. jsp.error.badaction=The action is not a recognizable standard action. - +jsp.error.circular.tagfile=The tag file {0} contains a circular dependency on itself. This is currently not implemented. 1.17 +13 -3 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java Index: JspServletWrapper.java === RCS file:
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
kinman 2002/08/29 11:31:20 Modified:jasper2/src/share/org/apache/jasper/compiler ParserController.java jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: - Fix the regression that isTagFile not passed correct when compiling tag files. Revision ChangesPath 1.17 +4 -3 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ParserController.java Index: ParserController.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ParserController.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- ParserController.java 28 Aug 2002 23:00:19 - 1.16 +++ ParserController.java 29 Aug 2002 18:31:20 - 1.17 @@ -112,7 +112,9 @@ private boolean isTopFile = true; /* - * Tells if this is a regular jsp page or tag file. + * Tells if the file to be parsed is a regular jsp page or tag file. + * Usually we get the info from the compilation context, but it can + * be temporarily overrideen with a parameter to the parse method */ private boolean isTagFile = false; @@ -136,7 +138,6 @@ this.ctxt = ctxt; // @@@ can we assert that ctxt is not null? this.compiler = compiler; } - public JspCompilationContext getJspCompilationContext () { return ctxt; @@ -157,7 +158,7 @@ */ public Node.Nodes parse(String inFileName) throws FileNotFoundException, JasperException, IOException { - return parse(inFileName, null, false); + return parse(inFileName, null, ctxt.isTagFile()); } /** 1.16 +7 -3 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java Index: JspServletWrapper.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- JspServletWrapper.java28 Aug 2002 23:00:19 - 1.15 +++ JspServletWrapper.java29 Aug 2002 18:31:20 - 1.16 @@ -244,6 +244,10 @@ return null; } +public boolean isTagFile() { + return this.isTagFile; +} + public void service(HttpServletRequest request, HttpServletResponse response, boolean precompile) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
kinman 2002/08/28 16:00:19 Modified:jasper2/src/share/org/apache/jasper/compiler Compiler.java Generator.java JspDocumentParser.java PageInfo.java Parser.java ParserController.java TagFileProcessor.java TagLibraryInfoImpl.java jasper2/src/share/org/apache/jasper/runtime HttpJspBase.java jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Added: jasper2/src/share/org/apache/jasper/runtime JspSourceDependent.java Log: - Fixed 12046: reloading of tag files - Fixed 11485: recompilation of jsp files when TLD is modified. - The generate servlet and tag handlers for the tag files now implements JspSourceDependent, which is used to provide dependency info at runtime. - Turned on include file dependency check. Added tag files and TLD to the dependency list. - Determined isTagFile property from TLD or implicit tag files. - Various minor fixes. Revision ChangesPath 1.31 +7 -25 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java Index: Compiler.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- Compiler.java 20 Aug 2002 23:35:30 - 1.30 +++ Compiler.java 28 Aug 2002 23:00:18 - 1.31 @@ -420,12 +420,13 @@ if( checkClass ) { targetFile = new File(ctxt.getClassFileName()); } else { -targetFile = new File( ctxt.getServletJavaFileName()); +targetFile = new File(ctxt.getServletJavaFileName()); } if (!targetFile.exists()) { return true; } + targetLastModified = targetFile.lastModified(); if (targetLastModified jspRealLastModified) { if( log.isDebugEnabled() ) @@ -433,36 +434,18 @@ return true; } -/* XXX turn off derived dependencies for now -// determine if compile time includes have been changed +// determine if source dependent files (e.g. includes using include + // directives) have been changed. if( jsw==null ) { return false; } -Servlet servlet=null; -try { -servlet = jsw.getServlet(); -} catch( ServletException ex1 ) { -} catch( IOException ex2 ) { -} -if (servlet == null) { -// System.out.println(Compiler: outdated, no servlet + targetFile ); -return true; -} -List includes = null; -// If the page contains a page directive with extends attribute -// it may not be an instance of HttpJspBase. -// For now only track dependencies on included files if this is not -// the case. A more complete solution is to generate the servlet -// to implement (say) JspInlcudes which contains getIncludes method. -if (servlet instanceof HttpJspBase) { -includes = ((HttpJspBase)servlet).getIncludes(); -} -if (includes == null) { +List depends = jsw.getDependants(); +if (depends == null) { return false; } -Iterator it = includes.iterator(); +Iterator it = depends.iterator(); while (it.hasNext()) { String include = (String)it.next(); try { @@ -481,7 +464,6 @@ return true; } } -*/ return false; } 1.83 +28 -23 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java Index: Generator.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v retrieving revision 1.82 retrieving revision 1.83 diff -u -r1.82 -r1.83 --- Generator.java28 Aug 2002 17:57:12 - 1.82 +++ Generator.java28 Aug 2002 23:00:18 - 1.83 @@ -170,7 +170,6 @@ out.println(); page.visit(new DeclarationVisitor()); - out.println(); } /** @@ -360,25 +359,25 @@ /** * Generation of static initializers in preamble. - * For example, include list, el function map, prefix map. + * For example, dependant list, el function map, prefix map. * (shared by servlet and tag handler preamble generation) */ private void genPreambleStaticInitializers() throws JasperException { -// Static data for getIncludes() -
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
luehe 2002/08/21 10:05:52 Modified:jasper2/src/share/org/apache/jasper JspCompilationContext.java jasper2/src/share/org/apache/jasper/compiler TagFileProcessor.java Validator.java jasper2/src/share/org/apache/jasper/resources messages.properties messages_es.properties messages_ja.properties jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: Implemented requirement that one jsp:param element must be present for each variable declared using the variable directive that has a 'fragment' attribute equal to the name of the fragment being invoked. Revision ChangesPath 1.18 +11 -4 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java Index: JspCompilationContext.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- JspCompilationContext.java20 Aug 2002 23:35:30 - 1.17 +++ JspCompilationContext.java21 Aug 2002 17:05:52 - 1.18 @@ -66,7 +66,7 @@ import java.util.*; import javax.servlet.ServletContext; import javax.servlet.jsp.tagext.TagInfo; - +import javax.servlet.jsp.tagext.TagData; import org.apache.jasper.compiler.JspRuntimeContext; import org.apache.jasper.compiler.JspReader; import org.apache.jasper.compiler.ServletWriter; @@ -123,6 +123,7 @@ protected boolean isTagFile; protected TagInfo tagInfo; +protected TagData tagData; // jspURI _must_ be relative to the context public JspCompilationContext(String jspUri, @@ -157,6 +158,7 @@ public JspCompilationContext(String tagfile, TagInfo tagInfo, + TagData tagData, Options options, ServletContext context, JspServletWrapper jsw, @@ -166,6 +168,7 @@ this(tagfile, false, options, context, jsw, rctxt); this.isTagFile = true; this.tagInfo = tagInfo; + this.tagData = tagData; this.tagFileJars = tagFileJars; if (tagFileJars != null tagFileJars.get(tagfile) != null) { isPackagedTagFile = true; @@ -357,6 +360,10 @@ public TagInfo getTagInfo() { return tagInfo; +} + +public TagData getTagData() { + return tagData; } /** 1.16 +7 -4 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagFileProcessor.java Index: TagFileProcessor.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TagFileProcessor.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- TagFileProcessor.java 20 Aug 2002 23:35:30 - 1.15 +++ TagFileProcessor.java 21 Aug 2002 17:05:52 - 1.16 @@ -333,7 +333,8 @@ * Compiles and loads a tagfile. */ public static Class loadTagFile(JspCompilationContext ctxt, - String tagFilePath, TagInfo tagInfo) + String tagFilePath, TagInfo tagInfo, + TagData tagData) throws JasperException { JspRuntimeContext rctxt = ctxt.getRuntimeContext(); @@ -347,6 +348,7 @@ ctxt.getOptions(), tagFilePath, tagInfo, + tagData, ctxt.getRuntimeContext(), ctxt.getTagFileJars()); } @@ -372,7 +374,8 @@ TagFileInfo tagFileInfo = n.getTagFileInfo(); if (tagFileInfo != null) { String tagFilePath = tagFileInfo.getPath(); - Class c = loadTagFile(ctxt, tagFilePath, n.getTagInfo()); + Class c = loadTagFile(ctxt, tagFilePath, n.getTagInfo(), + n.getTagData()); n.setTagHandlerClass(c); } } 1.25 +57 -15 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java Index: Validator.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Validator.java,v
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
luehe 2002/08/03 16:29:21 Modified:jasper2/src/share/org/apache/jasper JspCompilationContext.java jasper2/src/share/org/apache/jasper/compiler Compiler.java Generator.java JspRuntimeContext.java TagFileProcessor.java jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: Store tag file .java and .class files in standard location (/tagfiles/org/apache/jsp/), regardless of the original tag file path, and add this standard location to the compilation classpath for JSP pages Revision ChangesPath 1.14 +44 -32 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java Index: JspCompilationContext.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- JspCompilationContext.java1 Aug 2002 23:29:36 - 1.13 +++ JspCompilationContext.java3 Aug 2002 23:29:21 - 1.14 @@ -115,16 +115,20 @@ protected boolean reload = true; protected URLClassLoader jspLoader; -protected URL [] outUrls = new URL[1]; +protected URL[] outUrls = new URL[1]; protected Class servletClass; protected boolean isTagFile; protected TagInfo tagInfo; // jspURI _must_ be relative to the context -public JspCompilationContext(String jspUri, boolean isErrPage, Options options, - ServletContext context, JspServletWrapper jsw, +public JspCompilationContext(String jspUri, + boolean isErrPage, + Options options, + ServletContext context, + JspServletWrapper jsw, JspRuntimeContext rctxt) { + this.jspUri = canonicalURI(jspUri); this.isErrPage = isErrPage; this.options=options; @@ -146,9 +150,11 @@ this.rctxt=rctxt; } -public JspCompilationContext(String tagfile, TagInfo tagInfo, +public JspCompilationContext(String tagfile, + TagInfo tagInfo, Options options, - ServletContext context, JspServletWrapper jsw, + ServletContext context, + JspServletWrapper jsw, JspRuntimeContext rctxt) { this(tagfile, false, options, context, jsw, rctxt); @@ -200,8 +206,8 @@ return outputDir; } -public void setOutputDir( String s ) { -this.outputDir=s; +public void setOutputDir(String s) { +this.outputDir = s; } /** @@ -396,17 +402,23 @@ if (jspPath != null) { return jspPath; } -String dirName = getJspFile(); -int pos = dirName.lastIndexOf('/'); -if (pos 0) { -dirName = dirName.substring(0, pos + 1); -} else { -dirName = ; -} -jspPath = dirName + getServletClassName() + .java; -if (jspPath.startsWith(/)) { -jspPath = jspPath.substring(1); -} + + if (isTagFile) { + jspPath = tagfiles/org/apache/jsp/ + tagInfo.getTagName() + .java; + } else { + String dirName = getJspFile(); + int pos = dirName.lastIndexOf('/'); + if (pos 0) { + dirName = dirName.substring(0, pos + 1); + } else { + dirName = ; + } + jspPath = dirName + getServletClassName() + .java; + if (jspPath.startsWith(/)) { + jspPath = jspPath.substring(1); + } + } + return jspPath; } @@ -508,7 +520,7 @@ public void compile() throws JasperException, FileNotFoundException { createCompiler(); -if (jspCompiler.isOutDated()) { + if (jspCompiler.isOutDated()) { try { jspCompiler.compile(); reload = true; @@ -518,7 +530,7 @@ throw new JasperException( Constants.getString(jsp.error.unable.compile),ex); } -} + } } /** True if the servlet needs loading @@ -568,24 +580,24 @@ return servletClass; } -public void createOutdir() { +public void createOutdir(String dirPath) { File outDirF = null; try { URL outURL = options.getScratchDir().toURL(); -
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
costin 2002/08/01 10:17:28 Modified:jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: Compilation error with jikes. JasperException extend ServletException. Revision ChangesPath 1.9 +9 -4 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java Index: JspServletWrapper.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- JspServletWrapper.java31 Jul 2002 21:42:27 - 1.8 +++ JspServletWrapper.java1 Aug 2002 17:17:27 - 1.9 @@ -283,8 +283,13 @@ ex, Logger.ERROR); } } -} catch (JasperException ex) { +} catch (ServletException ex) { + throw ex; +} catch (IOException ex) { throw ex; +// Jikes won't compile this ( JasperException extends ServletException +//} catch (JasperException ex) { +//throw ex; } catch (Exception ex) { throw new JasperException(ex); } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
kinman 2002/08/01 16:29:36 Modified:jasper2/src/share/org/apache/jasper JspCompilationContext.java jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: - Don't wrap JasperException's so error from compiling tag file got displayed. Revision ChangesPath 1.13 +5 -3 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java Index: JspCompilationContext.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- JspCompilationContext.java1 Aug 2002 21:49:58 - 1.12 +++ JspCompilationContext.java1 Aug 2002 23:29:36 - 1.13 @@ -512,6 +512,8 @@ try { jspCompiler.compile(); reload = true; +} catch (JasperException ex) { +throw ex; } catch (Exception ex) { throw new JasperException( Constants.getString(jsp.error.unable.compile),ex); 1.10 +4 -6 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java Index: JspServletWrapper.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- JspServletWrapper.java1 Aug 2002 17:17:27 - 1.9 +++ JspServletWrapper.java1 Aug 2002 23:29:36 - 1.10 @@ -195,9 +195,7 @@ } } } catch (FileNotFoundException ex) { -throw new JasperException(ex); -} catch (JasperException ex) { -throw ex; +throw new JasperException(ex); } return tagHandlerClass; -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
kinman 2002/07/31 14:42:28 Modified:jasper2/src/share/org/apache/jasper JspCompilationContext.java jasper2/src/share/org/apache/jasper/compiler Compiler.java Generator.java JspDocumentParser.java Node.java Parser.java ParserController.java TagFileProcessor.java TagLibraryInfoImpl.java Validator.java jasper2/src/share/org/apache/jasper/resources messages.properties jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: - First cut at triggering compilations of tag files on demand. Node: Not fully working yet. Implicit tag file library not tested. Use absolute path for tag file in TLD. Revision ChangesPath 1.11 +43 -5 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java Index: JspCompilationContext.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspCompilationContext.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- JspCompilationContext.java25 Jul 2002 22:28:45 - 1.10 +++ JspCompilationContext.java31 Jul 2002 21:42:27 - 1.11 @@ -65,6 +65,8 @@ import java.net.*; import java.util.Set; import javax.servlet.ServletContext; +import javax.servlet.jsp.tagext.TagInfo; + import org.apache.jasper.compiler.JspRuntimeContext; import org.apache.jasper.compiler.JspReader; import org.apache.jasper.compiler.ServletWriter; @@ -116,6 +118,9 @@ protected URL [] outUrls = new URL[1]; protected Class servletClass; +protected boolean isTagFile; +protected TagInfo tagInfo; + // jspURI _must_ be relative to the context public JspCompilationContext(String jspUri, boolean isErrPage, Options options, ServletContext context, JspServletWrapper jsw, @@ -141,6 +146,17 @@ this.rctxt=rctxt; } +public JspCompilationContext(String tagfile, TagInfo tagInfo, + Options options, + ServletContext context, JspServletWrapper jsw, + JspRuntimeContext rctxt) { + +this(tagfile, false, options, context, jsw, rctxt); +this.isTagFile = true; +this.tagInfo = tagInfo; +return; +} + /* Methods to override */ /** -- Class path and loader -- */ @@ -304,6 +320,14 @@ this.isErrPage = isErrPage; } +public boolean isTagFile() { + return isTagFile; +} + +public TagInfo getTagInfo() { + return tagInfo; +} + /** * Package name for the generated class. */ @@ -351,6 +375,14 @@ return options; } +public ServletContext getServletContext() { + return context; +} + +public JspRuntimeContext getRuntimeContext() { + return rctxt; +} + /** * Path of the JSP relative to the work directory. */ @@ -503,8 +535,14 @@ rctxt.getPermissionCollection(), rctxt.getCodeSource()); -servletClass = jspLoader.loadClass( - getServletPackageName() + . + getServletClassName()); +String className; +if (isTagFile()) { +className = tagInfo.getTagClassName(); +} else { +className = getServletPackageName() + . + +getServletClassName(); +} +servletClass = jspLoader.loadClass(className); } catch (FileNotFoundException ex) { jspCompiler.removeGeneratedFiles(); throw ex; 1.22 +7 -3 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java Index: Compiler.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- Compiler.java 19 Jul 2002 01:13:46 - 1.21 +++ Compiler.java 31 Jul 2002 21:42:27 - 1.22 @@ -241,6 +241,10 @@ // Collect page info Collector.collect(this, pageNodes); + // Compile (if necessar) and load the tag files referenced in + // this compilation unit. + TagFileProcessor.loadTagFiles(this, pageNodes); + // generate servlet .java file Generator.generate(writer,
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
kinman 2002/07/18 18:13:47 Modified:jasper2/src/share/org/apache/jasper/compiler Compiler.java jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: - Fixed 10766: %@ page extends % causes ClassCastException Revision ChangesPath 1.21 +16 -6 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java Index: Compiler.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- Compiler.java 16 Jul 2002 23:40:06 - 1.20 +++ Compiler.java 19 Jul 2002 01:13:46 - 1.21 @@ -63,8 +63,9 @@ import java.util.*; import java.io.*; import java.net.URL; -import javax.servlet.jsp.tagext.TagInfo; +import javax.servlet.Servlet; import javax.servlet.ServletException; +import javax.servlet.jsp.tagext.TagInfo; import org.xml.sax.Attributes; @@ -386,7 +387,7 @@ if( jsw==null ) { return false; } -HttpJspBase servlet=null; +Servlet servlet=null; try { servlet = jsw.getServlet(); } catch( ServletException ex1 ) { @@ -396,7 +397,16 @@ // System.out.println(Compiler: outdated, no servlet + targetFile ); return true; } -List includes = servlet.getIncludes(); + +List includes = null; +// If the page contains a page directive with extends attribute +// it may not be an instance of HttpJspBase. +// For now only track dependencies on included files if this is not +// the case. A more complete solution is to generate the servlet +// to implement (say) JspInlcudes which contains getIncludes method. +if (servlet instanceof HttpJspBase) { +includes = ((HttpJspBase)servlet).getIncludes(); +} if (includes == null) { return false; } 1.7 +5 -5 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java Index: JspServletWrapper.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- JspServletWrapper.java24 Jun 2002 22:13:08 - 1.6 +++ JspServletWrapper.java19 Jul 2002 01:13:46 - 1.7 @@ -129,7 +129,7 @@ return ctxt; } -public HttpJspBase getServlet() +public Servlet getServlet() throws ServletException, IOException, FileNotFoundException { if (ctxt.isReload()) { @@ -153,7 +153,7 @@ } } } -return (HttpJspBase)theServlet; +return theServlet; } public ServletContext getServletContext() { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
kinman 2002/07/18 18:16:04 Modified:jasper2/src/share/org/apache/jasper/compiler Tag: tomcat_4_branch Compiler.java jasper2/src/share/org/apache/jasper/servlet Tag: tomcat_4_branch JspServletWrapper.java Log: - Fixed 10766: %@ page extends % causes ClassCastException Revision ChangesPath No revision No revision 1.18.2.1 +14 -5 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java Index: Compiler.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Compiler.java,v retrieving revision 1.18 retrieving revision 1.18.2.1 diff -u -r1.18 -r1.18.2.1 --- Compiler.java 21 Jun 2002 02:28:47 - 1.18 +++ Compiler.java 19 Jul 2002 01:16:04 - 1.18.2.1 @@ -376,7 +376,7 @@ if( jsw==null ) { return false; } -HttpJspBase servlet=null; +Servlet servlet=null; try { servlet = jsw.getServlet(); } catch( ServletException ex1 ) { @@ -386,7 +386,16 @@ // System.out.println(Compiler: outdated, no servlet + targetFile ); return true; } -List includes = servlet.getIncludes(); +List includes = null; +// If the page contains a page directive with extends attribute +// it may not be an instance of HttpJspBase. +// For now only track dependencies on included files if this is not +// the case. A more complete solution is to generate the servlet +// to implement (say) JspInlcudes which contains getIncludes method. +if (servlet instanceof HttpJspBase) { +includes = ((HttpJspBase)servlet).getIncludes(); +} + if (includes == null) { return false; } No revision No revision 1.6.2.1 +5 -5 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java Index: JspServletWrapper.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -r1.6 -r1.6.2.1 --- JspServletWrapper.java24 Jun 2002 22:13:08 - 1.6 +++ JspServletWrapper.java19 Jul 2002 01:16:04 - 1.6.2.1 @@ -129,7 +129,7 @@ return ctxt; } -public HttpJspBase getServlet() +public Servlet getServlet() throws ServletException, IOException, FileNotFoundException { if (ctxt.isReload()) { @@ -153,7 +153,7 @@ } } } -return (HttpJspBase)theServlet; +return theServlet; } public ServletContext getServletContext() { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
remm2002/06/24 15:13:08 Modified:jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: - Remove traces (put them back if they were there for a good reason). Revision ChangesPath 1.6 +3 -5 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java Index: JspServletWrapper.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- JspServletWrapper.java20 Jun 2002 23:05:27 - 1.5 +++ JspServletWrapper.java24 Jun 2002 22:13:08 - 1.6 @@ -137,7 +137,6 @@ // Synchronizing on jsw enables simultaneous loading // of different pages, but not the same page. if (ctxt.isReload()) { -System.out.println(JspServletWrapper - isReload ); // This is to maintain the original protocol. destroy(); @@ -180,7 +179,6 @@ if (options.getDevelopment()) { synchronized (this) { -System.out.println(JspServletWrapper - development compile ); ctxt.compile(); } } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
costin 2002/06/20 16:05:27 Modified:jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: Update to JspCompilationContext. Move the code to load the servlet in a method - that can also be called before service(), allowing us to load the class which in turns allow to detect the dependencies. Revision ChangesPath 1.5 +38 -22 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java Index: JspServletWrapper.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- JspServletWrapper.java11 May 2002 05:00:22 - 1.4 +++ JspServletWrapper.java20 Jun 2002 23:05:27 - 1.5 @@ -78,7 +78,7 @@ import org.apache.jasper.JasperException; import org.apache.jasper.Constants; import org.apache.jasper.Options; -import org.apache.jasper.JspEngineContext; +import org.apache.jasper.JspCompilationContext; import org.apache.jasper.compiler.JspRuntimeContext; import org.apache.jasper.runtime.HttpJspBase; @@ -106,7 +106,7 @@ private Servlet theServlet; private String jspUri; private Class servletClass; -private JspEngineContext ctxt; +private JspCompilationContext ctxt; private long available = 0L; private ServletConfig config; private Options options; @@ -118,16 +118,42 @@ this.config = config; this.options = options; this.jspUri = jspUri; -ctxt = new JspEngineContext -(rctxt, config.getServletContext(), jspUri, - this, isErrorPage, options); +ctxt = new JspCompilationContext( jspUri, isErrorPage, + options, + config.getServletContext(), + this, rctxt); +ctxt.createOutdir(); } -public JspEngineContext getJspEngineContext() { +public JspCompilationContext getJspEngineContext() { return ctxt; } -public HttpJspBase getServlet() { +public HttpJspBase getServlet() +throws ServletException, IOException, FileNotFoundException +{ +if (ctxt.isReload()) { +synchronized (this) { +// Synchronizing on jsw enables simultaneous loading +// of different pages, but not the same page. +if (ctxt.isReload()) { +System.out.println(JspServletWrapper - isReload ); +// This is to maintain the original protocol. +destroy(); + +try { +servletClass = ctxt.load(); +theServlet = (Servlet) servletClass.newInstance(); +} catch( IllegalAccessException ex1 ) { +throw new JasperException( ex1 ); +} catch( InstantiationException ex ) { +throw new JasperException( ex ); +} + +theServlet.init(config); +} +} +} return (HttpJspBase)theServlet; } @@ -154,23 +180,13 @@ if (options.getDevelopment()) { synchronized (this) { +System.out.println(JspServletWrapper - development compile ); ctxt.compile(); } } if (ctxt.isReload()) { -synchronized (this) { - -// Synchronizing on jsw enables simultaneous loading -// of different pages, but not the same page. -if (ctxt.isReload()) { -servletClass = ctxt.load(); -// This is to maintain the original protocol. -destroy(); -theServlet = (Servlet) servletClass.newInstance(); -theServlet.init(config); -} -} +getServlet(); } // If a page is to only to be precompiled return. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java
remm02/05/10 22:00:22 Modified:jasper2/src/share/org/apache/jasper EmbededServletOptions.java JspEngineContext.java jasper2/src/share/org/apache/jasper/servlet JspServletWrapper.java Log: - AFAIK, the current code wasn't implementing reloading properly when development = true. - This patch checks for an outdated JSP on every page access. - Defaults to development = true. - It could be a good idea to write some more visible docs on configuring Jasper, and maybe add a page for configuring that and the default web.xml in the admin webapp. Revision ChangesPath 1.4 +4 -4 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbededServletOptions.java Index: EmbededServletOptions.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbededServletOptions.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- EmbededServletOptions.java6 May 2002 04:33:15 - 1.3 +++ EmbededServletOptions.java11 May 2002 05:00:21 - 1.4 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbededServletOptions.java,v 1.3 2002/05/06 04:33:15 glenn Exp $ - * $Revision: 1.3 $ - * $Date: 2002/05/06 04:33:15 $ + * $Header: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbededServletOptions.java,v 1.4 2002/05/11 05:00:21 remm Exp $ + * $Revision: 1.4 $ + * $Date: 2002/05/11 05:00:21 $ * * * @@ -82,7 +82,7 @@ /** * Is Jasper being used in development mode? */ -public boolean development = false; +public boolean development = true; /** * Do you want to keep the generated Java files around? 1.7 +4 -4 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspEngineContext.java Index: JspEngineContext.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspEngineContext.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- JspEngineContext.java 6 May 2002 04:33:15 - 1.6 +++ JspEngineContext.java 11 May 2002 05:00:22 - 1.7 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspEngineContext.java,v 1.6 2002/05/06 04:33:15 glenn Exp $ - * $Revision: 1.6 $ - * $Date: 2002/05/06 04:33:15 $ + * $Header: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspEngineContext.java,v 1.7 2002/05/11 05:00:22 remm Exp $ + * $Revision: 1.7 $ + * $Date: 2002/05/11 05:00:22 $ * * * @@ -365,7 +365,7 @@ public Class load() throws JasperException, FileNotFoundException { try { -if (servletClass == null || options.getDevelopment()) { +if (servletClass == null !options.getDevelopment()) { compile(); } jspLoader = new JasperLoader 1.4 +9 -3 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java Index: JspServletWrapper.java === RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- JspServletWrapper.java6 May 2002 04:33:16 - 1.3 +++ JspServletWrapper.java11 May 2002 05:00:22 - 1.4 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v 1.3 2002/05/06 04:33:16 glenn Exp $ - * $Revision: 1.3 $ - * $Date: 2002/05/06 04:33:16 $ + * $Header: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java,v 1.4 2002/05/11 05:00:22 remm Exp $ + * $Revision: 1.4 $ + * $Date: 2002/05/11 05:00:22 $ * * The Apache Software License, Version 1.1 * @@ -150,6 +150,12 @@ response.sendError (HttpServletResponse.SC_SERVICE_UNAVAILABLE, Constants.getString(jsp.error.unavailable)); +} + +if (options.getDevelopment()) { +synchronized (this) { +ctxt.compile(); +} } if (ctxt.isReload()) { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: