Re: Of .war and .jar files - and .jsp class files

2004-04-02 Thread Malcolm Warren
That's not quite what I meant, but I shan't want to bother people any more 
with this question.
I can get along with what you told me in another email.

Thanks for you time.
Malcolm Warren
On Thu, 1 Apr 2004 09:06:51 -0600, QM [EMAIL PROTECTED] wrote:

: The automatically generated .class files in Tomcat are in the
: org.apache.jsp package, but the folders /org/apache/jsp aren't there in
: the file system, if you see what I mean. It would have been nice if the
: package logic had been followed through.
?
I'm not sure I follow.
I just checked my own jar of precompiled JSPs and saw the following:
org/apache/jsp/index_jsp.class
(etc, etc ...)
Perhaps I missed this in your original post: do you run Tomcat4 or 5?

My knowledge of (Tomcat) precomp is solely from the 5.x series.

-QM



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Of .war and .jar files - and .jsp class files

2004-04-01 Thread Malcolm Warren
Dear QM,

Just a footnote to this problem, if you're interested.
The difference between Tomcat and Jrun on this problem of packing up the 
automatcally-generated .class files for .jsps is considerable, and I have 
to say that in this case Jrun looks more logical. With Tomcat, as you have 
explained, in order to get it to work you have to create all the servlet 
mappings.

This wasn't necessary in Jrun, because you simply put a .jar file in place 
of the unpacked classes, and the servlet container had no trouble finding 
them, because the .jar file was in exactly the same place as the unpacked 
.class files.

For some reason there isn't this easy relationship between the location of 
the tomcat-generated .class files and the path through the file system. 
The automatically generated .class files in Tomcat are in the 
org.apache.jsp package, but the folders /org/apache/jsp aren't there in 
the file system, if you see what I mean. It would have been nice if the 
package logic had been followed through.

Regards,
Malcolm Warren


On Wed, 31 Mar 2004 09:50:41 -0600, QM [EMAIL PROTECTED] wrote:

On Wed, Mar 31, 2004 at 02:55:16PM +0200, Malcolm Warren wrote:
: Now when I transfer everything to my production server I would like to
: eliminate all of the .jsp pages from the application, and all of the 
.java
: files, and just send a .jar file containing the .class files in
: /work/Standalone/localhost/$applicationDir.

You can do this.
Sort of.
That's what precompilation is all about.
Please bear with me:
- JSPs get compiled down to servlets, either by you (precompiling) or by
  the container (at runtime).
- when the container compiles a JSP for you, it takes care of mapping
  the servlet to the context-relative URI that matches the JSP. So
  /x/y.jsp is mapped, behind the scenes, to some.package.x.y_jsp.class.
  To precompile the JSPs means you must tell Tomcat yourself which
  classes map to given URIs.  Hence the autogenerated file full of
  servlet and servlet-mapping entries I described in my last
  message.
- When you precompile, you have can even put the classes into a jar file,
  but that jar file must be in {dist}/WEB-INF/lib.  That's the only way
  Tomcat's classloader will find the jar.
- With the JSPs compiled down to code, and properly mapped in web.xml,
  you can remove the JSPs from your app.
See

	http://jakarta.apache.org/tomcat/tomcat-5.0-doc/printer/jasper-howto.html#Web%20Application%20Compilation

for more details on the precompilation process (assuming TC5).  It
mentions the generated web.xml fragment of which I spoke.


: That way the compilation is already done, and nobody can study my .jsp
: files. In theory I could just create a directory tree somewhere of
: org/apache/jsp/ copy all the automatically generated .class files into
: this directory tree and .jar it all up, and Tomcat should find them 
either
: in /WEB-INF/lib or in /work/Standalone/localhost/$applicationDir, but 
it
: doesn't.

Close, except that the jar of JSPs must exist in {dist}/WEB-INF/lib.
Tomcat won't load a jar from the context dir itself, aka
.//localhost/$applicationDir.  Just not how Tomcat works. ;)
-QM



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Of .war and .jar files - and .jsp class files

2004-04-01 Thread Niki Ivanchev
Reading http://jakarta.apache.org/tomcat/tomcat-5.0-doc/setup.html
I have noticed this
quote
   * *Java location*: The installer will use the registry or the
 JAVA_HOME environment variable to determine the base path of the
 JDK or a JRE. If only a JRE (or an incorrect path) is specified,
 Tomcat will run but will be unable to compile JSP pages at
 runtime. Either all webapps will need to be precompiled (this can
 be easily done using the Tomcat deployer), or the |lib\tools.jar|
 file from a JDK installation must be copied to the |common\lib|
 path of the Tomcat installation.
/quote
So your solution is named Tomcat deployer
Hope this helps
Niki
Malcolm Warren wrote:

I am changing from Jrun to Tomcat and I have just one problem remaining.

Jrun gave an additional security possibility that I am unable to 
extend to Tomcat. In Jrun you do not need to place your .jsp files, 
nor the automatically generated .java files on your production server. 
I could simply .jar up the automatically generated .class files and 
place the .jar file in the /WEB-INF/jsp folder on the production server.

That way I had 3 big advantages:
1) Nobody could look into my .jsp files.
2) Nobody could look into my .java files for my .jsps
3) Compilation on the production server of the .jsps was already done. 
- Everything was ready in the single .jar file.

Now perhaps I am missing something, so please put me right. And I'm 
just starting now to use ant and I've never bothered with .war files 
because I don't distribute my programmes, they're just used on our 
production server.

If I create a .war file for the production server then the .war file 
contains no compiled .jsps, just the original .jsp files - is that right?
There seem to me to be obvious advantages to what I was able to do in 
Jrun - can I do something similar in Tomcat?
In general I get many more security features with Tomcat 4.1, than I 
did with Jrun 3.1, but this particular possibility seems to me to be a 
good one. I have tried creating .jar files of the Tomcat's /work 
directory but without any success.

Can anybody enlighten me? Thanks for any help.

Regards,
Malcolm Warren
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





RE: Of .war and .jar files - and .jsp class files

2004-04-01 Thread Shapira, Yoav

Hi,

to say that in this case Jrun looks more logical. With Tomcat, as you
have
explained, in order to get it to work you have to create all the
servlet
mappings.

In order to get what to work?  Tomcat will run your JSPs without any
mappings in web.xml (except the default JSP servlet of course, which is
in the global web.xml).

The automatically generated .class files in Tomcat are in the
org.apache.jsp package,

Only if you don't put them in your own packages, as mentioned in the
FAQ.

Yoav Shapira




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Of .war and .jar files - and .jsp class files

2004-04-01 Thread QM

: The automatically generated .class files in Tomcat are in the 
: org.apache.jsp package, but the folders /org/apache/jsp aren't there in 
: the file system, if you see what I mean. It would have been nice if the 
: package logic had been followed through.

?
I'm not sure I follow.
I just checked my own jar of precompiled JSPs and saw the following:

org/apache/jsp/index_jsp.class
(etc, etc ...)

Perhaps I missed this in your original post: do you run Tomcat4 or 5?  

My knowledge of (Tomcat) precomp is solely from the 5.x series.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Of .war and .jar files - and .jsp class files

2004-03-31 Thread Martin Alley
Stick the class files in WEB-INF/classes in the appropriate package
hierarchy.

Eg. Com.mycompany.myclass in WEB-INF/classes/com/mycompany/myclass.class

-Original Message-
From: Malcolm Warren [mailto:[EMAIL PROTECTED] 
Sent: 31 March 2004 11:03
To: [EMAIL PROTECTED]
Subject: Of .war and .jar files - and .jsp class files


I am changing from Jrun to Tomcat and I have just one problem remaining.

Jrun gave an additional security possibility that I am unable to extend
to 
Tomcat. In Jrun you do not need to place your .jsp files, nor the 
automatically generated .java files on your production server. I could 
simply .jar up the automatically generated .class files and place the
.jar 
file in the /WEB-INF/jsp folder on the production server.

That way I had 3 big advantages:
1) Nobody could look into my .jsp files.
2) Nobody could look into my .java files for my .jsps
3) Compilation on the production server of the .jsps was already done. -

Everything was ready in the single .jar file.

Now perhaps I am missing something, so please put me right. And I'm just

starting now to use ant and I've never bothered with .war files because
I 
don't distribute my programmes, they're just used on our production
server.

If I create a .war file for the production server then the .war file 
contains no compiled .jsps, just the original .jsp files - is that
right?
There seem to me to be obvious advantages to what I was able to do in
Jrun 
- can I do something similar in Tomcat?
In general I get many more security features with Tomcat 4.1, than I did

with Jrun 3.1, but this particular possibility seems to me to be a good 
one. I have tried creating .jar files of the Tomcat's /work directory
but 
without any success.

Can anybody enlighten me? Thanks for any help.

Regards,
Malcolm Warren

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Of .war and .jar files - and .jsp class files

2004-03-31 Thread QM
On Wed, Mar 31, 2004 at 12:02:40PM +0200, Malcolm Warren wrote:
: Jrun gave an additional security possibility that I am unable to extend to 
: Tomcat. In Jrun you do not need to place your .jsp files, nor the 
: automatically generated .java files on your production server. I could 
: simply .jar up the automatically generated .class files and place the .jar 
: file in the /WEB-INF/jsp folder on the production server.


Tomcat does something similar:

- As one poster already mentioned, keep all of your jar files in
  WEB-INF/lib.

- make sure the JSPs are mapped to servlet paths in WEB-INF/web.xml.

(I'm out on a limb here, but it sounds as if Jrun automagically loads
your JSP jar file and creates the mappings for you.)

If the latter sounds like a pain in the rear, there are Ant tasks to do
the precompilation for you and generate the web.xml snippet.


: If I create a .war file for the production server then the .war file 
: contains no compiled .jsps, just the original .jsp files - is that right?

Not true.  The war file contains whatever you put in it.  JSPs, images,
jars, whatever.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Of .war and .jar files - and .jsp class files

2004-03-31 Thread FRANCOIS Dufour
hi to all
it mignt help you out a bit
for the nobody could look! look at your %Tomcat_home%/conf/web.xml read the 
instruction
you can disable listing there



[EMAIL PROTECTED]
administrateur http://entre-nous.qc.tc




From: Martin Alley [EMAIL PROTECTED]
Reply-To: Tomcat Users List [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Subject: RE: Of .war and .jar files - and .jsp class files
Date: Wed, 31 Mar 2004 12:44:14 +0100
Stick the class files in WEB-INF/classes in the appropriate package
hierarchy.
Eg. Com.mycompany.myclass in WEB-INF/classes/com/mycompany/myclass.class

-Original Message-
From: Malcolm Warren [mailto:[EMAIL PROTECTED]
Sent: 31 March 2004 11:03
To: [EMAIL PROTECTED]
Subject: Of .war and .jar files - and .jsp class files
I am changing from Jrun to Tomcat and I have just one problem remaining.

Jrun gave an additional security possibility that I am unable to extend
to
Tomcat. In Jrun you do not need to place your .jsp files, nor the
automatically generated .java files on your production server. I could
simply .jar up the automatically generated .class files and place the
.jar
file in the /WEB-INF/jsp folder on the production server.
That way I had 3 big advantages:
1) Nobody could look into my .jsp files.
2) Nobody could look into my .java files for my .jsps
3) Compilation on the production server of the .jsps was already done. -
Everything was ready in the single .jar file.

Now perhaps I am missing something, so please put me right. And I'm just

starting now to use ant and I've never bothered with .war files because
I
don't distribute my programmes, they're just used on our production
server.
If I create a .war file for the production server then the .war file
contains no compiled .jsps, just the original .jsp files - is that
right?
There seem to me to be obvious advantages to what I was able to do in
Jrun
- can I do something similar in Tomcat?
In general I get many more security features with Tomcat 4.1, than I did
with Jrun 3.1, but this particular possibility seems to me to be a good
one. I have tried creating .jar files of the Tomcat's /work directory
but
without any success.
Can anybody enlighten me? Thanks for any help.

Regards,
Malcolm Warren
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
MSN Messenger : discutez en direct avec vos amis !  
http://messenger.fr.msn.ca/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Of .war and .jar files - and .jsp class files

2004-03-31 Thread Malcolm Warren
Thank you very much for your answers, but they haven't quite hit the mark 
yet.

Every .jsp page in Tomcat, as we all know, is compiled in 
/work/Standalone/localhost/ in an appropriate application folder e.g. _ 
is the folder in the case of the ROOT application.
It's fine by me if this is done when I first access the page in a browser 
in my test environment.

Now when I transfer everything to my production server I would like to 
eliminate all of the .jsp pages from the application, and all of the .java 
files, and just send a .jar file containing the .class files in 
/work/Standalone/localhost/$applicationDir.
That way the compilation is already done, and nobody can study my .jsp 
files. In theory I could just create a directory tree somewhere of 
org/apache/jsp/ copy all the automatically generated .class files into 
this directory tree and .jar it all up, and Tomcat should find them either 
in /WEB-INF/lib or in /work/Standalone/localhost/$applicationDir, but it 
doesn't.

Of course I could be missing the point entirely here, and I shouldn't even 
by thinking about doing these things, but as I say, in Jrun I could send 
the automatically generated .jsp .class files to the production 
environment in a nice .jar file and I had more security because noone 
could read the original .jsp files, although to be honest there aren't any 
people in my company who would be interested in reading them, but I feel 
more secure that way.

Any more enlightenment on this would be very helpful.

On Wed, 31 Mar 2004 06:00:22 -0600, QM [EMAIL PROTECTED] wrote:

On Wed, Mar 31, 2004 at 12:02:40PM +0200, Malcolm Warren wrote:
: Jrun gave an additional security possibility that I am unable to 
extend to
: Tomcat. In Jrun you do not need to place your .jsp files, nor the
: automatically generated .java files on your production server. I could
: simply .jar up the automatically generated .class files and place the 
.jar
: file in the /WEB-INF/jsp folder on the production server.

Tomcat does something similar:

- As one poster already mentioned, keep all of your jar files in
  WEB-INF/lib.
- make sure the JSPs are mapped to servlet paths in WEB-INF/web.xml.

(I'm out on a limb here, but it sounds as if Jrun automagically loads
your JSP jar file and creates the mappings for you.)
If the latter sounds like a pain in the rear, there are Ant tasks to do
the precompilation for you and generate the web.xml snippet.
: If I create a .war file for the production server then the .war file
: contains no compiled .jsps, just the original .jsp files - is that 
right?

Not true.  The war file contains whatever you put in it.  JSPs, images,
jars, whatever.
-QM



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Of .war and .jar files - and .jsp class files

2004-03-31 Thread Shapira, Yoav

Hi,
You can precompile your JSPs and include the class files in the WAR.  In
addition, no one can see the compiled .java files for your JSPs anyways
because they're in tomcat's work directory, not in a web-accessible
location.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: Malcolm Warren [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 31, 2004 7:55 AM
To: Tomcat Users List
Subject: Re: Of .war and .jar files - and .jsp class files

Thank you very much for your answers, but they haven't quite hit the
mark
yet.

Every .jsp page in Tomcat, as we all know, is compiled in
/work/Standalone/localhost/ in an appropriate application folder e.g.
_
is the folder in the case of the ROOT application.
It's fine by me if this is done when I first access the page in a
browser
in my test environment.

Now when I transfer everything to my production server I would like to
eliminate all of the .jsp pages from the application, and all of the
.java
files, and just send a .jar file containing the .class files in
/work/Standalone/localhost/$applicationDir.
That way the compilation is already done, and nobody can study my .jsp
files. In theory I could just create a directory tree somewhere of
org/apache/jsp/ copy all the automatically generated .class files into
this directory tree and .jar it all up, and Tomcat should find them
either
in /WEB-INF/lib or in /work/Standalone/localhost/$applicationDir, but
it
doesn't.

Of course I could be missing the point entirely here, and I shouldn't
even
by thinking about doing these things, but as I say, in Jrun I could
send
the automatically generated .jsp .class files to the production
environment in a nice .jar file and I had more security because noone
could read the original .jsp files, although to be honest there aren't
any
people in my company who would be interested in reading them, but I
feel
more secure that way.

Any more enlightenment on this would be very helpful.

On Wed, 31 Mar 2004 06:00:22 -0600, QM [EMAIL PROTECTED] wrote:

 On Wed, Mar 31, 2004 at 12:02:40PM +0200, Malcolm Warren wrote:
 : Jrun gave an additional security possibility that I am unable to
 extend to
 : Tomcat. In Jrun you do not need to place your .jsp files, nor the
 : automatically generated .java files on your production server. I
could
 : simply .jar up the automatically generated .class files and place
the
 .jar
 : file in the /WEB-INF/jsp folder on the production server.


 Tomcat does something similar:

 - As one poster already mentioned, keep all of your jar files in
   WEB-INF/lib.

 - make sure the JSPs are mapped to servlet paths in WEB-INF/web.xml.

 (I'm out on a limb here, but it sounds as if Jrun automagically loads
 your JSP jar file and creates the mappings for you.)

 If the latter sounds like a pain in the rear, there are Ant tasks to
do
 the precompilation for you and generate the web.xml snippet.


 : If I create a .war file for the production server then the .war
file
 : contains no compiled .jsps, just the original .jsp files - is that
 right?

 Not true.  The war file contains whatever you put in it.  JSPs,
images,
 jars, whatever.

 -QM




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Of .war and .jar files - and .jsp class files

2004-03-31 Thread Niki Ivanchev
I think, he means that he can redistribute his application wihtout 
giving the person who will install the application on it's server the 
access to jps code.
Obviously no one can access jsp code via web server.
Niki

Shapira, Yoav wrote:

Hi,
You can precompile your JSPs and include the class files in the WAR.  In
addition, no one can see the compiled .java files for your JSPs anyways
because they're in tomcat's work directory, not in a web-accessible
location.
Yoav Shapira
Millennium Research Informatics
 

-Original Message-
From: Malcolm Warren [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 31, 2004 7:55 AM
To: Tomcat Users List
Subject: Re: Of .war and .jar files - and .jsp class files
Thank you very much for your answers, but they haven't quite hit the
   

mark
 

yet.

Every .jsp page in Tomcat, as we all know, is compiled in
/work/Standalone/localhost/ in an appropriate application folder e.g.
   

_
 

is the folder in the case of the ROOT application.
It's fine by me if this is done when I first access the page in a
   

browser
 

in my test environment.

Now when I transfer everything to my production server I would like to
eliminate all of the .jsp pages from the application, and all of the
   

.java
 

files, and just send a .jar file containing the .class files in
/work/Standalone/localhost/$applicationDir.
That way the compilation is already done, and nobody can study my .jsp
files. In theory I could just create a directory tree somewhere of
org/apache/jsp/ copy all the automatically generated .class files into
this directory tree and .jar it all up, and Tomcat should find them
   

either
 

in /WEB-INF/lib or in /work/Standalone/localhost/$applicationDir, but
   

it
 

doesn't.

Of course I could be missing the point entirely here, and I shouldn't
   

even
 

by thinking about doing these things, but as I say, in Jrun I could
   

send
 

the automatically generated .jsp .class files to the production
environment in a nice .jar file and I had more security because noone
could read the original .jsp files, although to be honest there aren't
   

any
 

people in my company who would be interested in reading them, but I
   

feel
 

more secure that way.

Any more enlightenment on this would be very helpful.

On Wed, 31 Mar 2004 06:00:22 -0600, QM [EMAIL PROTECTED] wrote:

   

On Wed, Mar 31, 2004 at 12:02:40PM +0200, Malcolm Warren wrote:
: Jrun gave an additional security possibility that I am unable to
extend to
: Tomcat. In Jrun you do not need to place your .jsp files, nor the
: automatically generated .java files on your production server. I
 

could
 

: simply .jar up the automatically generated .class files and place
 

the
 

.jar
: file in the /WEB-INF/jsp folder on the production server.
Tomcat does something similar:

- As one poster already mentioned, keep all of your jar files in
 WEB-INF/lib.
- make sure the JSPs are mapped to servlet paths in WEB-INF/web.xml.

(I'm out on a limb here, but it sounds as if Jrun automagically loads
your JSP jar file and creates the mappings for you.)
If the latter sounds like a pain in the rear, there are Ant tasks to
 

do
 

the precompilation for you and generate the web.xml snippet.

: If I create a .war file for the production server then the .war
 

file
 

: contains no compiled .jsps, just the original .jsp files - is that
right?
Not true.  The war file contains whatever you put in it.  JSPs,
 

images,
 

jars, whatever.

-QM

 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   





This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged.  This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender.  Thank you.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


 




Re: Of .war and .jar files - and .jsp class files

2004-03-31 Thread QM
On Wed, Mar 31, 2004 at 02:55:16PM +0200, Malcolm Warren wrote:
: Now when I transfer everything to my production server I would like to 
: eliminate all of the .jsp pages from the application, and all of the .java 
: files, and just send a .jar file containing the .class files in 
: /work/Standalone/localhost/$applicationDir.

You can do this.
Sort of.

That's what precompilation is all about.
Please bear with me:

- JSPs get compiled down to servlets, either by you (precompiling) or by
  the container (at runtime).

- when the container compiles a JSP for you, it takes care of mapping
  the servlet to the context-relative URI that matches the JSP. So
  /x/y.jsp is mapped, behind the scenes, to some.package.x.y_jsp.class.

  To precompile the JSPs means you must tell Tomcat yourself which
  classes map to given URIs.  Hence the autogenerated file full of
  servlet and servlet-mapping entries I described in my last
  message.

- When you precompile, you have can even put the classes into a jar file,
  but that jar file must be in {dist}/WEB-INF/lib.  That's the only way
  Tomcat's classloader will find the jar.

- With the JSPs compiled down to code, and properly mapped in web.xml,
  you can remove the JSPs from your app.

See 


http://jakarta.apache.org/tomcat/tomcat-5.0-doc/printer/jasper-howto.html#Web%20Application%20Compilation

for more details on the precompilation process (assuming TC5).  It
mentions the generated web.xml fragment of which I spoke.



: That way the compilation is already done, and nobody can study my .jsp 
: files. In theory I could just create a directory tree somewhere of 
: org/apache/jsp/ copy all the automatically generated .class files into 
: this directory tree and .jar it all up, and Tomcat should find them either 
: in /WEB-INF/lib or in /work/Standalone/localhost/$applicationDir, but it 
: doesn't.

Close, except that the jar of JSPs must exist in {dist}/WEB-INF/lib.
Tomcat won't load a jar from the context dir itself, aka
.//localhost/$applicationDir.  Just not how Tomcat works. ;)

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Of .war and .jar files - and .jsp class files

2004-03-31 Thread Malcolm Warren
Ok, thanks. That looks like what I'm looking for.
Sorry I didn't catch on after your first missive.
On Wed, 31 Mar 2004 09:50:41 -0600, QM [EMAIL PROTECTED] wrote:

On Wed, Mar 31, 2004 at 02:55:16PM +0200, Malcolm Warren wrote:
: Now when I transfer everything to my production server I would like to
: eliminate all of the .jsp pages from the application, and all of the 
.java
: files, and just send a .jar file containing the .class files in
: /work/Standalone/localhost/$applicationDir.

You can do this.
Sort of.
That's what precompilation is all about.
Please bear with me:
- JSPs get compiled down to servlets, either by you (precompiling) or by
  the container (at runtime).
- when the container compiles a JSP for you, it takes care of mapping
  the servlet to the context-relative URI that matches the JSP. So
  /x/y.jsp is mapped, behind the scenes, to some.package.x.y_jsp.class.
  To precompile the JSPs means you must tell Tomcat yourself which
  classes map to given URIs.  Hence the autogenerated file full of
  servlet and servlet-mapping entries I described in my last
  message.
- When you precompile, you have can even put the classes into a jar file,
  but that jar file must be in {dist}/WEB-INF/lib.  That's the only way
  Tomcat's classloader will find the jar.
- With the JSPs compiled down to code, and properly mapped in web.xml,
  you can remove the JSPs from your app.
See

	http://jakarta.apache.org/tomcat/tomcat-5.0-doc/printer/jasper-howto.html#Web%20Application%20Compilation

for more details on the precompilation process (assuming TC5).  It
mentions the generated web.xml fragment of which I spoke.


: That way the compilation is already done, and nobody can study my .jsp
: files. In theory I could just create a directory tree somewhere of
: org/apache/jsp/ copy all the automatically generated .class files into
: this directory tree and .jar it all up, and Tomcat should find them 
either
: in /WEB-INF/lib or in /work/Standalone/localhost/$applicationDir, but 
it
: doesn't.

Close, except that the jar of JSPs must exist in {dist}/WEB-INF/lib.
Tomcat won't load a jar from the context dir itself, aka
.//localhost/$applicationDir.  Just not how Tomcat works. ;)
-QM



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]