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 Sun, 06 Jul 2003 22:56:54 GMT
remm        2003/07/06 15:56:54

  Modified:    jasper2/src/share/org/apache/jasper JspC.java
               jasper2/src/share/org/apache/jasper/resources
                        messages.properties
  Log:
  - Support regenerating the web.xml without manually removing the generated
    servlet mappings (this fixes issues when not doing a build clean between two
    compilations).
  - Also remove generated web.xml fragment.
  
  Revision  Changes    Path
  1.48      +26 -3     jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java
  
  Index: JspC.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/JspC.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- JspC.java	30 Jun 2003 22:10:00 -0000	1.47
  +++ JspC.java	6 Jul 2003 22:56:54 -0000	1.48
  @@ -575,6 +575,10 @@
           File webappBase = new File(uriRoot);
           File webXml = new File(webappBase, "WEB-INF/web.xml");
           File webXml2 = new File(webappBase, "WEB-INF/web2.xml");
  +        String insertStartMarker = 
  +            Localizer.getMessage("jspc.webinc.insertStart");
  +        String insertEndMarker = 
  +            Localizer.getMessage("jspc.webinc.insertEnd");
   
           BufferedReader reader = new BufferedReader(new FileReader(webXml));
           BufferedReader fragmentReader = 
  @@ -589,6 +593,22 @@
               if (line == null) {
                   break;
               }
  +            // Skip anything previously generated by JSPC
  +            if (line.indexOf(insertStartMarker) >= 0) {
  +                while (true) {
  +                    line = reader.readLine();
  +                    if (line == null) {
  +                        return;
  +                    }
  +                    if (line.indexOf(insertEndMarker) >= 0) {
  +                        line = reader.readLine();
  +                        if (line == null) {
  +                            return;
  +                        }
  +                        break;
  +                    }
  +                }
  +            }
               for (int i = 0; i < insertBefore.length; i++) {
                   pos = line.indexOf(insertBefore[i]);
                   if (pos >= 0)
  @@ -602,6 +622,7 @@
               }
           }
   
  +        writer.println(insertStartMarker);
           while (true) {
               String line2 = fragmentReader.readLine();
               if (line2 == null) {
  @@ -609,6 +630,7 @@
               }
               writer.println(line2);
           }
  +        writer.println(insertEndMarker);
   
           writer.println(line.substring(pos));
   
  @@ -640,6 +662,7 @@
           fos.close();
   
           webXml2.delete();
  +        (new File(webxmlFile)).delete();
   
       }
   
  
  
  
  1.119     +3 -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.118
  retrieving revision 1.119
  diff -u -r1.118 -r1.119
  --- messages.properties	19 Jun 2003 21:06:30 -0000	1.118
  +++ messages.properties	6 Jul 2003 22:56:54 -0000	1.119
  @@ -238,6 +238,8 @@
   resource-ref, security-constraint, login-config, security-role,\n\
   env-entry, and ejb-ref elements should follow this fragment.\n\
   -->\n
  +jspc.webinc.insertEnd=<!-- JSPC servlet mappings end -->
  +jspc.webinc.insertStart=<!-- JSPC servlet mappings start -->
   jspc.error.jasperException=error-the file ''{0}'' generated the following parse exception:
{1}
   jspc.error.generalException=ERROR-the file ''{0}'' generated the following general exception:
   jspc.error.fileDoesNotExist=The file argument ''{0}'' does not exist
  
  
  

---------------------------------------------------------------------
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