tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Downey" <steve.dow...@netfolio.com>
Subject RE: Jasper 2 class files
Date Wed, 21 Aug 2002 20:13:12 GMT
Bingo! It can't!

{BTW, it shouldn't be org.jasper.xxxxx, as that's Paul Jasper's site,
whoever he is}

What should be happening with JspC [and in the JspServlet IMO] is:
/hello.jsp => org.apache.jsp.hello_jsp in {output}/hello_jsp.java
/subdir/hello.jsp => org.apache.jsp.subdir.hello_jsp in
{output}/subdir/hello_jsp.java

with the resultant web.xml fragment:

<servlet>
	<servlet-name>org.apache.jsp.hello_jsp</servlet-name>
	<servlet-class>org.apache.jsp.hello_jsp</servlet-class>
</servlet>
<servlet>
	<servlet-name>org.apache.jsp.subdir.hello_jsp</servlet-name>
	<servlet-class>org.apache.jsp.subdir.hello_jsp</servlet-class>
</servlet>
<servlet-mapping>
	<servlet-name>org.apache.jsp.hello_jsp</servlet-name>
	<url-pattern>/hello.jsp</url-pattern>
</servlet-mapping>
<servlet-mapping>
	<servlet-name>org.apache.jsp.subdir.hello_jsp</servlet-name>
	<url-pattern>/subdir/hello.jsp</url-pattern>
</servlet-mapping>

Then they can be compiled by an ordinary <javac> ant task, and warred and
deployed in any servlet container.

Now, why might you want to do this?

The resultant WAR file can be put into a container that doesn't have JSP or
tools.jar support. It's great for embedded applications. Much lower
overhead, and more predictable response. It's also great for QA. You test
exactly the bits that get shipped.


> -----Original Message-----
> From: John Trollinger [mailto:jakarta@trollingers.com]
> Sent: Wednesday, August 21, 2002 3:16 PM
> To: 'Tomcat Developers List'
> Subject: RE: Jasper 2 class files
>
>
> If you take the generated class files and war them up and just call them
> as servlets how does the classloader differentiate
> /org.jasper.jsp.hello_jsp from /subdir/org.jasper.jsp.hello_jsp.  I can
> see how it does it when a JSP file exists but if you just move the
> generated files over I don't see how the classloader could figure this
> out?
>
> If this is in your web.xml how does it know one hello_jsp from the other
> without the jsp pages there and without going through jasper?
>
> 	<servlet>
>  		<servlet-name>org.apache.jsp.hello_jsp</servlet-name>
>  		<servlet-class>org.apache.jsp.hello_jsp</servlet-class>
>  	</servlet>
>
>  	<servlet-mapping>
>  		<servlet-name>org.apache.jsp.hello_jsp</servlet-name>
>  		<url-pattern>/subdir/hello.jsp</url-pattern>
>  	</servlet-mapping>
>
> -----Original Message-----
> From: Steve Downey [mailto:steve.downey@netfolio.com]
> Sent: Wednesday, August 21, 2002 2:56 PM
> To: Tomcat Developers List
> Subject: Re: Jasper 2 class files
>
> Is jspcache the place that Tomcat is looking for generated classes? If
> so,
> then the custom JSP classloader is doing its magic.
>
> The java and class files produced by the JspC command line compiler
> should be
> able to be jared up and placed into the WEB-INF directory, like any
> other
> servlet.  And the web.xml then maps the jsp URIs to servlets.
>
> Jasper 1 could do this, I provided some of the patches to make it work.
>
> The real test is to take all of the output from JspC and create a WAR
> file
> from it. Without the base jsp files. This WAR should operate in ANY
> servlet
> container.
>
>
> On Wednesday 21 August 2002 02:22 pm, John Trollinger wrote:
> > Greg,
> >
> > I took this off of the bug tracking because it is not a bug and I
> > thought there are people a lot smarter than me in this mailing list
> that
> > could help answer you questions.
> >
> > I do not know how jasper differentiates between hello.jsp and
> > /anydir/hello.jsp when the both compile to a class
> > org.jasper.jsp.hello_jsp but it does work...
> >
> > My hello.jsp in the root dir prints hello Jasper world and my
> hello.jsp
> > in the subdir prints hello john world.  It works without a hitch..
> > (notice that I have removed the .java files for the 2 hello world
> files
> > and it did not regenerate them)
> >
> > Here is my file list
> >
> > Directory of C:\appserver\Tomcat\jspcache
> >
> > 08/21/2002  02:19 PM    <DIR>          .
> > 08/21/2002  02:19 PM    <DIR>          ..
> > 08/21/2002  11:47 AM             3,496 date_jsp.java
> > 08/21/2002  11:52 AM             2,975 hello_jsp.class
> > 08/21/2002  11:51 AM             2,883 index_jsp.class
> > 08/21/2002  11:51 AM             1,863 index_jsp.java
> > 08/21/2002  01:27 PM    <DIR>          subdir
> >                4 File(s)         11,217 bytes
> >
> >  Directory of C:\appserver\Tomcat\jspcache\subdir
> >
> > 08/21/2002  01:27 PM    <DIR>          .
> > 08/21/2002  01:27 PM    <DIR>          ..
> > 08/21/2002  11:47 AM             3,334 date2_jsp.java
> > 08/21/2002  11:52 AM             2,970 hello_jsp.class
> >
> > Here is my jsp.xml
> >
> > <!--
> > Automatically created by Tomcat JspC.
> > Place this fragement in the web.xml before all icon, display-name,
> > description, distributable, and context-param elements.
> > -->
> >
> > 	<servlet>
> > 		<servlet-name>org.apache.jsp.date_jsp</servlet-name>
> > 		<servlet-class>org.apache.jsp.date_jsp</servlet-class>
> > 	</servlet>
> >
> > 	<servlet>
> > 		<servlet-name>org.apache.jsp.hello_jsp</servlet-name>
> > 		<servlet-class>org.apache.jsp.hello_jsp</servlet-class>
> > 	</servlet>
> >
> > 	<servlet>
> > 		<servlet-name>org.apache.jsp.date2_jsp</servlet-name>
> > 		<servlet-class>org.apache.jsp.date2_jsp</servlet-class>
> > 	</servlet>
> >
> > 	<servlet>
> > 		<servlet-name>org.apache.jsp.hello_jsp</servlet-name>
> > 		<servlet-class>org.apache.jsp.hello_jsp</servlet-class>
> > 	</servlet>
> >
> > 	<servlet-mapping>
> > 		<servlet-name>org.apache.jsp.date_jsp</servlet-name>
> > 		<url-pattern>/date.jsp</url-pattern>
> > 	</servlet-mapping>
> >
> > 	<servlet-mapping>
> > 		<servlet-name>org.apache.jsp.hello_jsp</servlet-name>
> > 		<url-pattern>/hello.jsp</url-pattern>
> > 	</servlet-mapping>
> >
> > 	<servlet-mapping>
> > 		<servlet-name>org.apache.jsp.date2_jsp</servlet-name>
> > 		<url-pattern>/subdir/date2.jsp</url-pattern>
> > 	</servlet-mapping>
> >
> > 	<servlet-mapping>
> > 		<servlet-name>org.apache.jsp.hello_jsp</servlet-name>
> > 		<url-pattern>/subdir/hello.jsp</url-pattern>
> > 	</servlet-mapping>
> >
> > <!--
> > All session-config, mime-mapping, welcome-file-list, error-page,
> taglib,
> > resource-ref, security-constraint, login-config, security-role,
> > env-entry, and ejb-ref elements should follow this fragment.
> > -->
>
>
> --
> To unsubscribe, e-mail:
> <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:tomcat-dev-help@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
<mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>




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


Mime
View raw message