RE: jspc pre-compiled pages distributed with .war file?

2002-10-25 Thread John Trollinger
The jspc command does not put real package names on the jsp.class
files.  What happens is each jsp page gets its own classloader so if you
have 2 index.jsp files they will still run.  To do what you want to do
you have to have each jsp generated .java file have a real package
name so that when you deploy the class files to tomcat it can resolve
the classes correctly.

There have been a few threads on both this and the developer list about
work arounds to this.. Don't have the links.. But I suggest you try
there.

Also there is an option on jspc for jasper that will create the web.xml
fragment for all the mappings for the jsp servlets.

 -Original Message-
 From: Thomas Heller [mailto:th.heller;mx4k.com] 
 Sent: Friday, October 25, 2002 10:24 AM
 To: Tomcat Users List
 Subject: jspc pre-compiled pages distributed with .war file?
 
 
 hi there,
 
 i am migrating my projects from php to java and began to set 
 up a development server that ideally does all the dev work 
 once a project is marked release i just call an ant task to 
 deploy the project to one or more (load balanced) production servers.
 
 i have written an ant build.xml to compile my webapp and to 
 put everything i need into mywebapp.war. thats working very 
 fine and i can just deploy that .war to a tomcat server 
 without any problems.
 
 now, i have setup another ant task to precompile every jsp 
 file using jasper (ant task jspc). thats working perfectly 
 fine and i have loads of index_jsp.java, etc files. now i 
 compile those to .class files and i would like to distribute 
 them inside the .war file so that the tomcat server itself 
 doesnt need to compile anything by himself. _Ideally_ i'd 
 like to exclude _any_ .jsp file in the .war file and just 
 include the compiled jsp.class files.
 
 but i wonder ... tomcat somehow doesnt really know what i'm 
 sending him and he doesnt recognize any of the precompiled 
 pages. how do i tell tomcat to use the precompiled pages in 
 the .war instead of compiling them himself?
 
 i know i can write this it into my web.xml
 
 servlet
 servlet-nameindex_jsp/servlet-name
 servlet-class
   my.package.jsp.index_jsp
 /servlet-class
 /servlet
 
 servlet-mapping
 servlet-nameindex_jsp/servlet-name
 url-pattern/index.jsp/url-pattern
 /servlet-mapping
 
 but somehow i dont like it this way, but i would rather use 
 this instead of putting jsp files into the .war file. would 
 be cool if tomcat would do something like this by himself 
 when he finds *_jsp.class in a /WEB-INF/precompiled directory.
 
 Anyways maybe tomcat has some support for what i'm trying to 
 find and i just can't find it? Comments welcome
 
 Greetings,
 Thomas
 
 
 
 
 --
 To unsubscribe, e-mail:   
 mailto:tomcat-user- [EMAIL PROTECTED]
 For 
 additional commands, 
 e-mail: mailto:tomcat-user-help;jakarta.apache.org
 


--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org




RE: jspc pre-compiled pages distributed with .war file?

2002-10-25 Thread Felipe Schnack
  I created an ANT script to generate the class files, and I'm with the
same problemas Thomas have. But about this jspc option to generate
web.xml... I think ant doesn't support it, does it?
  (I'm using Ant 1.5)

On Fri, 2002-10-25 at 13:29, John Trollinger wrote:
 The jspc command does not put real package names on the jsp.class
 files.  What happens is each jsp page gets its own classloader so if you
 have 2 index.jsp files they will still run.  To do what you want to do
 you have to have each jsp generated .java file have a real package
 name so that when you deploy the class files to tomcat it can resolve
 the classes correctly.
 
 There have been a few threads on both this and the developer list about
 work arounds to this.. Don't have the links.. But I suggest you try
 there.
 
 Also there is an option on jspc for jasper that will create the web.xml
 fragment for all the mappings for the jsp servlets.
 
  -Original Message-
  From: Thomas Heller [mailto:th.heller;mx4k.com] 
  Sent: Friday, October 25, 2002 10:24 AM
  To: Tomcat Users List
  Subject: jspc pre-compiled pages distributed with .war file?
  
  
  hi there,
  
  i am migrating my projects from php to java and began to set 
  up a development server that ideally does all the dev work 
  once a project is marked release i just call an ant task to 
  deploy the project to one or more (load balanced) production servers.
  
  i have written an ant build.xml to compile my webapp and to 
  put everything i need into mywebapp.war. thats working very 
  fine and i can just deploy that .war to a tomcat server 
  without any problems.
  
  now, i have setup another ant task to precompile every jsp 
  file using jasper (ant task jspc). thats working perfectly 
  fine and i have loads of index_jsp.java, etc files. now i 
  compile those to .class files and i would like to distribute 
  them inside the .war file so that the tomcat server itself 
  doesnt need to compile anything by himself. _Ideally_ i'd 
  like to exclude _any_ .jsp file in the .war file and just 
  include the compiled jsp.class files.
  
  but i wonder ... tomcat somehow doesnt really know what i'm 
  sending him and he doesnt recognize any of the precompiled 
  pages. how do i tell tomcat to use the precompiled pages in 
  the .war instead of compiling them himself?
  
  i know i can write this it into my web.xml
  
  servlet
  servlet-nameindex_jsp/servlet-name
  servlet-class
my.package.jsp.index_jsp
  /servlet-class
  /servlet
  
  servlet-mapping
  servlet-nameindex_jsp/servlet-name
  url-pattern/index.jsp/url-pattern
  /servlet-mapping
  
  but somehow i dont like it this way, but i would rather use 
  this instead of putting jsp files into the .war file. would 
  be cool if tomcat would do something like this by himself 
  when he finds *_jsp.class in a /WEB-INF/precompiled directory.
  
  Anyways maybe tomcat has some support for what i'm trying to 
  find and i just can't find it? Comments welcome
  
  Greetings,
  Thomas
  
  
  
  
  --
  To unsubscribe, e-mail:   
  mailto:tomcat-user- [EMAIL PROTECTED]
  For 
  additional commands, 
  e-mail: mailto:tomcat-user-help;jakarta.apache.org
  
 
 
 --
 To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
 For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
 
-- 

Felipe Schnack
Analista de Sistemas
[EMAIL PROTECTED]
Cel.: (51)91287530
Linux Counter #281893

Faculdade Ritter dos Reis
www.ritterdosreis.br
[EMAIL PROTECTED]
Fone/Fax.: (51)32303328


--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org




RE: jspc pre-compiled pages distributed with .war file?

2002-10-25 Thread John Trollinger
I created my own ant task that does all the jspc.bat does.  I have tried
to relay the code to the ant community with no luck..



 -Original Message-
 From: Felipe Schnack [mailto:felipes;ritterdosreis.br] 
 Sent: Friday, October 25, 2002 10:36 AM
 To: Tomcat Users List
 Subject: RE: jspc pre-compiled pages distributed with .war file?
 
 
   I created an ANT script to generate the class files, and 
 I'm with the same problemas Thomas have. But about this jspc 
 option to generate web.xml... I think ant doesn't support it, does it?
   (I'm using Ant 1.5)
 
 On Fri, 2002-10-25 at 13:29, John Trollinger wrote:
  The jspc command does not put real package names on the jsp.class 
  files.  What happens is each jsp page gets its own 
 classloader so if 
  you have 2 index.jsp files they will still run.  To do what 
 you want 
  to do you have to have each jsp generated .java file have a real 
  package name so that when you deploy the class files to 
 tomcat it can 
  resolve the classes correctly.
  
  There have been a few threads on both this and the developer list 
  about work arounds to this.. Don't have the links.. But I 
 suggest you 
  try there.
  
  Also there is an option on jspc for jasper that will create the 
  web.xml fragment for all the mappings for the jsp servlets.
  
   -Original Message-
   From: Thomas Heller [mailto:th.heller;mx4k.com]
   Sent: Friday, October 25, 2002 10:24 AM
   To: Tomcat Users List
   Subject: jspc pre-compiled pages distributed with .war file?
   
   
   hi there,
   
   i am migrating my projects from php to java and began to set
   up a development server that ideally does all the dev work 
   once a project is marked release i just call an ant task to 
   deploy the project to one or more (load balanced) 
 production servers.
   
   i have written an ant build.xml to compile my webapp and to
   put everything i need into mywebapp.war. thats working very 
   fine and i can just deploy that .war to a tomcat server 
   without any problems.
   
   now, i have setup another ant task to precompile every jsp
   file using jasper (ant task jspc). thats working perfectly 
   fine and i have loads of index_jsp.java, etc files. now i 
   compile those to .class files and i would like to distribute 
   them inside the .war file so that the tomcat server itself 
   doesnt need to compile anything by himself. _Ideally_ i'd 
   like to exclude _any_ .jsp file in the .war file and just 
   include the compiled jsp.class files.
   
   but i wonder ... tomcat somehow doesnt really know what i'm
   sending him and he doesnt recognize any of the precompiled 
   pages. how do i tell tomcat to use the precompiled pages in 
   the .war instead of compiling them himself?
   
   i know i can write this it into my web.xml
   
   servlet
   servlet-nameindex_jsp/servlet-name
   servlet-class
 my.package.jsp.index_jsp
   /servlet-class
   /servlet
   
   servlet-mapping
   servlet-nameindex_jsp/servlet-name
   url-pattern/index.jsp/url-pattern
   /servlet-mapping
   
   but somehow i dont like it this way, but i would rather use
   this instead of putting jsp files into the .war file. would 
   be cool if tomcat would do something like this by himself 
   when he finds *_jsp.class in a /WEB-INF/precompiled directory.
   
   Anyways maybe tomcat has some support for what i'm trying to
   find and i just can't find it? Comments welcome
   
   Greetings,
   Thomas
   
   
   
   
   --
   To unsubscribe, e-mail:   
   mailto:tomcat-user- [EMAIL PROTECTED]
   For
   additional commands, 
   e-mail: mailto:tomcat-user-help;jakarta.apache.org
   
  
  
  --
  To unsubscribe, e-mail:   
 mailto:tomcat-user- [EMAIL PROTECTED]
  For 
 additional commands, 
 e-mail: 
  mailto:tomcat-user-help;jakarta.apache.org
  
 -- 
 
 Felipe Schnack
 Analista de Sistemas
 [EMAIL PROTECTED]
 Cel.: (51)91287530
 Linux Counter #281893
 
 Faculdade Ritter dos Reis
 www.ritterdosreis.br
 [EMAIL PROTECTED]
 Fone/Fax.: (51)32303328
 
 
 --
 To unsubscribe, e-mail:   
 mailto:tomcat-user- [EMAIL PROTECTED]
 For 
 additional commands, 
 e-mail: mailto:tomcat-user-help;jakarta.apache.org
 


--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org




Re: jspc pre-compiled pages distributed with .war file?

2002-10-25 Thread Andy Wagg
Tomcat requires the servlet and servlet mappings in the web.xml, this is 
the way it works. Essentially, servlets are generated for the jsp pages. 
I modified my web application this week to precompile the jsp files and 
no longer include these in my war.

The JspC compiler when used with the -webapp option, also allows the use 
of either -webxml or -webinc to generate a complete web.xml file or just 
the servlet and servlet mappings to be included. I found I couldnt do 
this using the ant jspc command, but rather used a java task to run the 
jspc command.

My generated .java classes were then compiled with all my other classes 
and put in the war.

Andy.


Thomas Heller wrote:
hi there,

i am migrating my projects from php to java and began to set up a
development server that ideally does all the dev work once a project is
marked release i just call an ant task to deploy the project to one or more
(load balanced) production servers.

i have written an ant build.xml to compile my webapp and to put everything i
need into mywebapp.war. thats working very fine and i can just deploy that
.war to a tomcat server without any problems.

now, i have setup another ant task to precompile every jsp file using jasper
(ant task jspc). thats working perfectly fine and i have loads of
index_jsp.java, etc files. now i compile those to .class files and i would
like to distribute them inside the .war file so that the tomcat server
itself doesnt need to compile anything by himself. _Ideally_ i'd like to
exclude _any_ .jsp file in the .war file and just include the compiled
jsp.class files.

but i wonder ... tomcat somehow doesnt really know what i'm sending him and
he doesnt recognize any of the precompiled pages. how do i tell tomcat to
use the precompiled pages in the .war instead of compiling them himself?

i know i can write this it into my web.xml

servlet
servlet-nameindex_jsp/servlet-name
servlet-class
  my.package.jsp.index_jsp
/servlet-class
/servlet

servlet-mapping
servlet-nameindex_jsp/servlet-name
url-pattern/index.jsp/url-pattern
/servlet-mapping

but somehow i dont like it this way, but i would rather use this instead of
putting jsp files into the .war file. would be cool if tomcat would do
something like this by himself when he finds *_jsp.class in a
/WEB-INF/precompiled directory.

Anyways maybe tomcat has some support for what i'm trying to find and i just
can't find it? Comments welcome

Greetings,
Thomas




--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org







--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org