Re: jsp precompilation

2001-12-04 Thread Denis Balazuc

You might want to look at a mixture between JSPC (Tomcat) and Ant

>>I'm searching a script ( bash-unix and/or bat-windows )
You should then use Ant and create Ant tasks that you need (if you need to
write some...)


>>that would :

>>- generate java files from jsp
>> - compile generated java files
use JSPC (why not within Ant ? I don't remember if JSPC has a task on its
own but you can write one if it does not, or use a simple shell-command
task)

>> - compile servlet java files
Use Ant and the JDK you're working with

>>- create the .war

Definitely, you should use Ant ;-)

http://jakarta.apache.org/ant

Cheers
Denis



--
To unsubscribe:   
For additional commands: 
Troubles with the list: 




Re: jsp precompilation

2001-12-04 Thread Nikola Milutinovic

Laurent Michenaud wrote:

> Hi,
> 
> I'm searching a script ( bash-unix and/or bat-windows )
> that would :
> - generate java files from jsp


In Tomcat's ./bin dir there is "jasper.sh", this is how you invoke it:

${CATALINA_HOME}/bin/jasper.sh jspc MyPage.jsp

This will produce MyPage.java


> - compile generated java files


javac -classpath ${CATALINA_HOME}/common/lib/servlet.jar MyPage.java


> - compile servlet java files


javac MyServlet.java


> - create the .war


mv MyPage.class ${MY_WEB_APP_HOME}/WEB-INF/classes/path/to/my/package/
jar cf MyWebApp.war ${MY_WEB_APP_HOME}

Or be advanced - make a build.xml for Ant and do it that way.




--
To unsubscribe:   
For additional commands: 
Troubles with the list: 




Re: JSP Precompilation with Tomcat 5

2004-08-11 Thread QM
On Tue, Aug 10, 2004 at 11:44:54PM -0400, [EMAIL PROTECTED] wrote:
: BUILD FAILED
: java.lang.IncompatibleClassChangeError: Implementing class

Given the definition of IncompatibleClassChangeError[1], it sounds like
you have a rogue JAR or classfile somewhere in the classpath.  If you're
upgrading from Tomcat 4 -> 5 beware of lingering v4 code.

Check the various "endorsed" dirs, as people sometimes put JARs there
out of desperation and then forget about them.

Also, this looks odd:

: 
: 

I don't know whether it's "wrong," just that my precompilation works
without it. =)


: 
: 
: 

Wouldn't this be "common/lib/jasper-compiler.jar" ?
-and wouldn't you also need servlet-api.jar and jsp-api.jar?

-QM

[1] = 
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/IncompatibleClassChangeError.html

   Thrown when an incompatible class change has occurred to some class
   definition. The definition of some class, on which the currently
   executing method depends, has since changed.


-- 

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: JSP Precompilation / JSPC / JSP servlet mapping

2003-07-18 Thread Justin Ruthenbeck
At 09:24 AM 7/18/2003, you wrote:
Hi,

I've set my Tomcat 4.1.24 installation to production mode, i.e. I've set 
'development' to false, 'reloading' to true and 'fork' to true in 
CATALINA_HOME/conf/web.xml.
If you're in production, reloading should be false (you don't want to poll 
for changed resources).

I have some JSPs that are modified from time to time.  My questions are:
... all answered many times.

STFA for "precompile" or derivatives:
http://marc.theaimsgroup.com/?l=tomcat-user
RTFM under "Web Application Compilation"
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jasper-howto.html
If you still can't find the answers, post again and we'll clarify.

justin


1a. Why is the package name for java files generated from a JSP 
compilation different when using JSPC and when you let Jasper compile the 
JSP when you access it (especially for JSP in directories in a context)?

1b. Can you use JSPC to precompile JSPs into the work directory without 
having to wait till they are accessed or using something like UNIX's wget 
to 'touch' the file and force a compilation?

2. How exactly does Jasper precompile JSPs into the work directory?  Can 
one write an Ant build file to precompile JSPs in a context to the work 
dir the same way Jasper does?

3. If you've precompiled your JSPs and mapped them in web.xml would Jasper 
precompile them and reload them if they are subsequently modified?

4. What are the advantages of mapping JSPs in web.xml as opposed to having 
Jasper compile them in the work directory?

Zach.



Justin Ruthenbeck
Software Engineer, NextEngine Inc.
justinr - AT - nextengine DOT com
Confidential
   See http://www.nextengine.com/confidentiality.php

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


Re: JSP Precompilation / JSPC / JSP servlet mapping

2003-07-18 Thread Lukas Bradley

"Then, the declarations and mappings for the servlets which were generated
during the precompilation must be added to the web application deployment
descriptor. Insert the ${webapp.path}/WEB-INF/generated_web.xml at the right
place inside the ${webapp.path}/WEB-INF/web.xml file. Restart the web
application (using the manager) and test it to verify it is running fine
with precompiled servlets. An appropriate token placed in the web
application deployment descriptor may also be used to automatically insert
the generated servlet declarations and mappings using Ant filtering
capabilities. This is actually how all the webapps distributed with Tomcat
are automatically compiled as part of the build process."

This is the part that is very unclear.  Please explain the use of the
webXmlFragment and how it can be used to place the mappings into a web.xml.

Lukas




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



Re: JSP Precompilation / JSPC / JSP servlet mapping

2003-07-18 Thread Justin Ruthenbeck
At 01:46 PM 7/18/2003, you wrote:
"...An appropriate token placed in the web
application deployment descriptor may also be used to automatically insert
the generated servlet declarations and mappings using Ant filtering
capabilities. This is actually how all the webapps distributed with Tomcat
are automatically compiled as part of the build process."
This is the part that is very unclear.  Please explain the use of the
webXmlFragment and how it can be used to place the mappings into a web.xml.
See Ant's Filter task documentation.  Basically, you take your web.xml as 
you have it (without any of the precompiled jsp information) and add a 
token like "@jspServletXml" where you want the fragment placed at.  Then 
define a  in your build xml (using "jspServletXml" and 
"webXmlFragment") and copy your existing web.xml to a new location (with 
filtering=true) -- this replaces "@jspServletXml" with jasper2's generated xml.

Disclaimer: I don't use this method because the Ant tasks don't do what 
I  need it to do (I need to support builds with precompile for multiple 
appservers).  Instead, I manually enter all information for our precompiled 
jsps in the web.xml and use a different script for running jspc.

justin


Justin Ruthenbeck
Software Engineer, NextEngine Inc.
justinr - AT - nextengine DOT com
Confidential
   See http://www.nextengine.com/confidentiality.php

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


Re: JSP precompilation and including "webinc.xml" in web.xml

2002-08-13 Thread Kris Schneider

Al,

If it's of any use at this point, your setup should work under 4.1. I
did something very similar that worked with 4.1.8.

Al Tingley wrote:
> 
> Hello,
> We are trying to automate the pre-compilation of our JSP files with JspC and
> the inclusion of the generated "webinc.xml" file in our application
> "web.xml" file.  We have constructed an application web.xml as shown below.
> Both "web.xml" and "webinc.xml" are local to the
> .../webapps//WEB-INF/ directory.
> 
> Our problem is that Tomcat complains when starting up with the message:
>  org.xml.sax.SAXParseException: Relative URI "webinc.xml"; can not
> be resolved without a base URI.
> 
> Note the local reference to "webinc.xml" below in the DOCTYPE tag.
> 
> If we change the reference to "webinc.xml" to an absolute URI of the form
> below (on Windows):
> 
> file://E/jakarta-tomcat-4.0.4b3/webapps/appname/WEB-INF/webinc.xml
> 
> ... we get a null pointer exception when Tomcat starts up (parser error at
> the line where we reference the file to be included):
> 
> 2002-06-04 08:55:27 ContextConfig[/voicemail] Parse error in application
> web.xml
> java.lang.NullPointerException
> at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:524)
> at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
> at
> org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
> at
> org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:314)
> ...
> 
> What are we doing wrong?  We're using Tomcat 4.0.4b3.
> Thanks,
> Alan Tingley
> Iperia, Inc.
> 
> ---
> The application web.xml file:
> 
> 
> 
>  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
> "http://java.sun.com/dtd/web-app_2_3.dtd";
> []
> >
> 
> 
> 
> &includes;
> 
> 
> ---
> Output when starting up Tomcat:
> 
> Starting service Tomcat-Standalone
> Apache Tomcat/4.0.4-b3
> PARSE error at line 6 column -1
> org.xml.sax.SAXParseException: Relative URI "webinc.xml"; can not be
> resolved without a base URI.
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 

-- 
Kris Schneider 
D.O.Tech   


smime.p7s
Description: S/MIME Cryptographic Signature


Re: JSP precompilation and including "webinc.xml" in web.xml

2002-06-05 Thread David M. Karr

> "Al" == Al Tingley <[EMAIL PROTECTED]> writes:

Al> Hello,
Al> We are trying to automate the pre-compilation of our JSP files with JspC and
Al> the inclusion of the generated "webinc.xml" file in our application
Al> "web.xml" file.  We have constructed an application web.xml as shown below.
Al> Both "web.xml" and "webinc.xml" are local to the
Al> .../webapps//WEB-INF/ directory.

Al> Our problem is that Tomcat complains when starting up with the message:
Al>  org.xml.sax.SAXParseException: Relative URI "webinc.xml"; can not
Al> be resolved without a base URI.

Al> Note the local reference to "webinc.xml" below in the DOCTYPE tag.

I got the complete precompilation process to work, but I gave up on trying to
reference the include file with an entity reference.  It just doesn't work.

What I was able to do was write an XSLT stylesheet that takes the main
"web.xml" and the generated include file and generates a new "web.xml" that
incorporates both files.  It uses the Ant "style" task to do the
transformation.

A slight wrinkle is that the generated include file is not a fully
"well-formed" XML file, in that it doesn't have a "root" element.  So, in order
for the XML parser (used by Ant) to grok it, I had to write a simple
well-formed wrapper that references the include file with an entity reference.
It's ironic that I'm using the same mechanism in this process that I gave up
with using inside of Tomcat.

I'll show all the pieces of my solution here.

This is the excerpt from my "build-war" Ant target related to this:

-
  
  
  
   
   



   
  
  
  
   
  
  
  
   



 

   
   
  
  
   

   
   


   
  
  
   


   
  
-

Following this is the "includeWrapper.xml" file, which references the generated
include file.  Note that I have to reference a path of "web-inf/webinc.xml",
which is the path to the generated file in my build tree (not my deploy tree).
I'm using Ant 1.4.  In Ant 1.5.1, there is apparently some new features in the
"style" task that allow the specification of an alternate EntityResolver that
would allow me to avoid hardcoding the name of the directory the file is in.

-

http://java.sun.com/dtd/web-app_2_3.dtd";
[

]
>

 &webinc;

-

And finally, here is the stylesheet (webmerge.xsl) that does the
transformation:

-

http://www.w3.org/1999/XSL/Transform";>

 

 http://java.sun.com/dtd/web-app_2_3.dtd"/>

 

 
 
   
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
   
 

 
   
 
   
 
   
   
 


-

-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   
For additional commands, e-mail: