ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Lenz <cml...@gmx.de>
Subject Re: jasperc question
Date Sat, 18 Jan 2003 10:51:08 GMT
Steve Loughran wrote:
> Now that I'm looking at fixing the name mangling, I'm confused.
> 
> There are two jasperc compilers in the source tree
>     jakarta-tomcat-jasper
> and another under jakarta-tomcat-4.0, which is probably what the current
> jspnamemangler came from.
> 
>>>From the branch tree it is jakarta-tomcat-jasper that is active. The latter
> does its name mangling thusly:
> 
>     public String getServletClassName() {
>         if (servletClassName != null) {
>             return servletClassName;
>         }
>         int iSep = jspUri.lastIndexOf('/') + 1;
>         int iEnd = jspUri.length();
>         StringBuffer modifiedClassName =
>             new StringBuffer(jspUri.length() - iSep);
>  if (!Character.isJavaIdentifierStart(jspUri.charAt(iSep))) {
>      // If the first char is not a legal Java letter or digit,
>      // prepend a '_'.
>      modifiedClassName.append('_');
>  }
>         for (int i = iSep; i < iEnd; i++) {
>             char ch = jspUri.charAt(i);
>             if (Character.isJavaIdentifierPart(ch)) {
>                 modifiedClassName.append(ch);
>             } else if (ch == '.') {
>                 modifiedClassName.append('_');
>             } else {
>                 modifiedClassName.append(mangleChar(ch));
>             }
>         }
>         servletClassName = modifiedClassName.toString();
>         return servletClassName;
>     }
> 
> So the rules are pretty simple, except I dont see the addtion of the _jsp at
> the end. Where does that come from? Does anyone know their way round jasper

I would think the jspUri *contains* the .jsp suffix, while in the 
for-loop the dot is replaced with an underscore so you get a _jsp suffix.

> *and* what any likely changes are due.
> 
> -Steve


-- 
Christopher Lenz
/=/ cmlenz at gmx.de


--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message