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 JspCompilationContext.java
Date Tue, 17 Aug 2004 22:25:01 GMT
remm        2004/08/17 15:25:01

  Modified:    jasper2/src/share/org/apache/jasper
                        JspCompilationContext.java
  Log:
  - Fix bad package name when compiling a tag file.
  
  Revision  Changes    Path
  1.51      +17 -7     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.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- JspCompilationContext.java	17 Aug 2004 09:05:50 -0000	1.50
  +++ JspCompilationContext.java	17 Aug 2004 22:25:01 -0000	1.51
  @@ -367,19 +367,29 @@
        * derived package name directly mirrors the file heirachy of the JSP page.
        */
       public String getServletPackageName() {
  -        String dPackageName = getDerivedPackageName();
  -	if (dPackageName.length() == 0) {
  -            return basePackageName;
  +        if (isTagFile()) {
  +            String className = tagInfo.getTagClassName();
  +            int lastIndex = className.lastIndexOf('.');
  +            String pkgName = "";
  +            if (lastIndex != -1) {
  +                pkgName = className.substring(0, lastIndex);
  +            }
  +            return pkgName;
  +        } else {
  +            String dPackageName = getDerivedPackageName();
  +            if (dPackageName.length() == 0) {
  +                return basePackageName;
  +            }
  +            return basePackageName + '.' + getDerivedPackageName();
           }
  -        return basePackageName + '.' + getDerivedPackageName();
       }
   
       private String getDerivedPackageName() {
  -	if (derivedPackageName == null) {
  +        if (derivedPackageName == null) {
               int iSep = jspUri.lastIndexOf('/');
               derivedPackageName = (iSep > 0) ?
  -                JspUtil.makeJavaPackage(jspUri.substring(1,iSep)) : "";
  -         }
  +                    JspUtil.makeJavaPackage(jspUri.substring(1,iSep)) : "";
  +        }
           return derivedPackageName;
       }
   	    
  
  
  

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