tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Cronin <tcro...@AUSTIN.CollegeClub.com>
Subject RE: want to preporcess javascript files
Date Thu, 28 Dec 2000 15:27:36 GMT
>- I dont see why a js file won't be handled like a jsp regarding source
>control and revision history.

this is not a problem. It is handled by source control, But I don't want
to send revision history and code documentation to client machines.

>- It costs you in performance to use js in jsp - you make the Tomcat
>generate them again and again for each request. I guess that the js code is
>quite static and not changed between requests, so that generation is
>unnecessary.

if I have it as the src attribute in the script tag it will only be
downloaded once
to each client, and if I cache the jsp page it will be resident in memory
intead of reading it from disk before sending it down.

>- I have a js file whose code depends on some other java classes. I have
>made in java a sort of preprocessor that create it whenever a new version
is
>required.

The Jakarta team has done a great job at writing a preprocessor which I
don't
want or have the time to do.

So back to my origonal question does anyone know how I could do this without
telling me why I should not.


-----Original Message-----
From: Boaz Shaham [mailto:Boazs@farechase.com]
Sent: Thursday, December 28, 2000 3:17 AM
To: 'tomcat-user@jakarta.apache.org'
Subject: RE: want to preporcess javascript files


I had that problem too. Some notes:

- I dont see why a js file won't be handled like a jsp regarding source
control and revision history.

- It costs you in performance to use js in jsp - you make the Tomcat
generate them again and again for each request. I guess that the js code is
quite static and not changed between requests, so that generation is
unnecessary.

- I have a js file whose code depends on some other java classes. I have
made in java a sort of preprocessor that create it whenever a new version is
required.

If you still want to use it as jsp - try add to these files a header
indicating the mime type for js code (dont know what it is)


- Boaz

-----Original Message-----
From: Tim Cronin [mailto:tcronin@AUSTIN.CollegeClub.com]
Sent: Wednesday, December 27, 2000 23:17
To: 'tomcat-user@jakarta.apache.org'
Cc: Paul Lange; Frank Livaudais; Rex Staples
Subject: want to preporcess javascript files


I was initially using jsp files to contain javascript. This way I could
have them documented and keep revision history in them for development
then have the commenst stripped out when they were deployed to clients.

This works fine in IE. but causes Netscape to hang. I tryed to change
them back to js and add a handler to preprocess these files as well
but could not get it to work.

Any solutions?

Mime
View raw message