Home
TeamSite
JSP preview and compilation
arildju
We have a few JSP pages that are deployed through TeamSite (version 5.01) to an iPlanet production web server.
There is also a iPlanet web server installed on the same server as TeamSite.
The JSP pages must be precompiled before they are deployed, and the class files must be deployed as well to the production server.
My questions are:
1. Can the JSP files be previewed directly by clicking on the the JSP file in TeamSite? (Using the standard iPlanet web server on the TS box)
2. Is there an easy way to compile the JSP files in TeamSite before they are published and then deploy all class files?
I would be grateful for any tips to solve this.
Find more posts tagged with
Comments
tvaughan
Hi arildju,
Yeah, you can setup TeamSite to preview JSPs off your Interwoven server by either configuring your iw.cfg to redirect *.jsp files to an app server you install on your TeamSite box, or by virtualizing the appserver's approot to be one of your STAGING or WORKAREAs (make liberal use of symbolic links)
You can also pre-compile JSP files in TeamSite, but it'll take about an hour to crank out a custom CGI to do that for you. For example, you could write a quick perl script called
$iwhome/httpd/iw-bin/precom-jsps.cgi
and set it up as a custom menu item in your TeamSite File menu.
The functionality of that script would be to traverse through a branch's STAGING area, find all instances of *.jsp, run your precompile command on those JSPs and save the resulting classes to either a WORKAREA (where they then get submitted) or to some /tmp directory. The last step of the menu item CGI (assuming successful JSP compilation) would be to assemble a file list and do a deployment of the classes to your remote app server. You could even use a DNR command to bounce the remote app server, or force it to re-read all classes & jars.
Hope that helps,
Tom
arildju
Thanks for the help.
Do you have any tips on how to build the pre-compile command for the JSPs?
- Arild
tvaughan
Most app servers come with some command-line tool that lets you pre-compile a JSP. If you're lucky, your app server comes with a command that lets you precompile a whole directory.
If not, just run some command like :
find
source-dir
-type f -name '*.jsp*' -exec
compile-command
{} \;
Or use the xargs command or maybe build a filelist of your JSPs dynamically and run the precompile command off that filelist. A million ways to go, really . . .
Tom
Johnny
Also
Most app servers can be configured to pre compile JSP's on start up.
Have a look at your documentation for this.
John
Sydney, Australia