You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Glenn Nielsen <gl...@voyager.apg.more.net> on 2001/02/07 03:48:09 UTC

Re: cvs commit: jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper CommandLineContext.java

Mel Martinez wrote:
> 
> The package naming solution I've opt'ed for in my own
> enhancement to Jasper (which I'll gladly share) is to
> derive package names that are related to the location
> of the jsp relative to the server context.  This is
> simple, flexible and should avoid collisions.
> 

There is no need for all this complexity to generate a package name
in the new Jasper.  The way jasper now loads jsp pages, each page is
completely isolated from all other pages.  Every jsp page compiled 
could be a class named "org.apache.jsp.MyJSP" without
any concern whatsoever about conflicts because each individual page
has its own class loader.  I will modify the current jasper class loader
to support putting the jsp pages in a package, but this is just to comply
with the JSP 1.2 spec.

All of the previous code in jasper to do all the package and class name
mangling was to overcome the limitations of how the Jasper class loader
for jsp pages was designed.

The new jasper makes it very easy to find and view the java source for
a translated jsp page, it is located in 
work/somehost/someapp/some/context/path/MyJSP.java.

Regards,

Glenn

----------------------------------------------------------------------
Glenn Nielsen             glenn@more.net | /* Spelin donut madder    |
MOREnet System Programming               |  * if iz ina coment.      |
Missouri Research and Education Network  |  */                       |
----------------------------------------------------------------------

Re: cvs commit: jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper CommandLineContext.java

Posted by cm...@yahoo.com.
> > > The new jasper makes it very easy to find and view
> > > the java source for
> > > a translated jsp page, it is located in
> > > work/somehost/someapp/some/context/path/MyJSP.java.
> > >
> > 
> > Does it not seem logical to assign a package to the
> > MyJSP class based on all or part of the above path?
> > 
> > This may seem like esthetics, I suppose.  Not
> > something we should get stressed about.
> > 
> > What you've done is a great improvement over what was
> > there.  Does it work with tc 3.3?
> > 
> 
> It should work for tc 3.x, but I don't have the time to
> back port it.

Well, it works in tomcat 3.x for some time ( too long ago to remember,
it's part of the original JspInterceptor :-)

The scheme is slightly different, but the ideea is the 
same ( using simpler and predictible names for the 
generated classes ). 



-- 
Costin


Re: cvs commit: jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper CommandLineContext.java

Posted by Glenn Nielsen <gl...@voyager.apg.more.net>.
Mel Martinez wrote:
> 
> --- Glenn Nielsen <gl...@voyager.apg.more.net> wrote:
> 
> > There is no need for all this complexity to generate
> > a package name
> > in the new Jasper.
> 
> Hmmm... compared to the gobbledy-gook that was being
> done before, I'd hardly call what I did complex.
> Aside from options, all it does is very simply asign
> the JSP page a package name based on it's directory
> hierarchy and place the .java and .class files in same
> - this is consistant with strict java naming
> convention.
> 
>  The way jasper now loads jsp
> > pages, each page is
> > completely isolated from all other pages.  Every jsp
> > page compiled
> > could be a class named "org.apache.jsp.MyJSP"
> > without
> > any concern whatsoever about conflicts because each
> > individual page
> > has its own class loader.
> 
> Ah, I see, you avoid file-level conflicts by placing
> the generated code into separate directory paths, even
> though the package names (currently) do not reflect
> the directory locations.  Yup, that should work,
> although i wouldn't say it is any less complex and I
> don't think it is consistent with standard java
> package/directory naming conventions.
> 
> > The new jasper makes it very easy to find and view
> > the java source for
> > a translated jsp page, it is located in
> > work/somehost/someapp/some/context/path/MyJSP.java.
> >
> 
> Does it not seem logical to assign a package to the
> MyJSP class based on all or part of the above path?
> 
> This may seem like esthetics, I suppose.  Not
> something we should get stressed about.
> 
> What you've done is a great improvement over what was
> there.  Does it work with tc 3.3?
> 

It should work for tc 3.x, but I don't have the time to
back port it.

----------------------------------------------------------------------
Glenn Nielsen             glenn@more.net | /* Spelin donut madder    |
MOREnet System Programming               |  * if iz ina coment.      |
Missouri Research and Education Network  |  */                       |
----------------------------------------------------------------------

Re: cvs commit: jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper CommandLineContext.java

Posted by Mel Martinez <me...@yahoo.com>.
--- Glenn Nielsen <gl...@voyager.apg.more.net> wrote:

> There is no need for all this complexity to generate
> a package name
> in the new Jasper.

Hmmm... compared to the gobbledy-gook that was being
done before, I'd hardly call what I did complex. 
Aside from options, all it does is very simply asign
the JSP page a package name based on it's directory
hierarchy and place the .java and .class files in same
- this is consistant with strict java naming
convention.

 The way jasper now loads jsp
> pages, each page is
> completely isolated from all other pages.  Every jsp
> page compiled 
> could be a class named "org.apache.jsp.MyJSP"
> without
> any concern whatsoever about conflicts because each
> individual page
> has its own class loader. 

Ah, I see, you avoid file-level conflicts by placing
the generated code into separate directory paths, even
though the package names (currently) do not reflect
the directory locations.  Yup, that should work,
although i wouldn't say it is any less complex and I
don't think it is consistent with standard java
package/directory naming conventions.

> The new jasper makes it very easy to find and view
> the java source for
> a translated jsp page, it is located in 
> work/somehost/someapp/some/context/path/MyJSP.java.
> 

Does it not seem logical to assign a package to the
MyJSP class based on all or part of the above path?

This may seem like esthetics, I suppose.  Not
something we should get stressed about.

What you've done is a great improvement over what was
there.  Does it work with tc 3.3?

Mel


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/