Deploying Deployment: How to Achieve Editing and Reloading with JSP Pages?

The Out project uses WebLogic as the web server and uses mostly JSP for the user interface. With a standard setup, you can copy the edited JSP files to the deployed deployment directory and WebLogic will automatically pick them up, recompile, and serve the new content over HTTP. However, is it possible not to copy at all, so I just save the file in my editor, and this is immediately (well, after a couple of seconds to recompile) apparently?

The project uses Apache Ant. I would assume that I want it to be possible with symlinks (since this is for deployment only I'm not interested cross-platform), but then I don't see how it is possible to symbolically link to many files at the same time using Ant.

So how do I achieve the functionality of save-JSP-hit-F5-in-browser either

  • with some settings in WebLogic; or
  • with symbolic JSPs using Apache Ant (instead of copying them, as is done now); or
  • something else?
+2


a source to share


3 answers


In the end, I had to use the Ant tool exec

because it's symlink

very awkward. Also, delete

follows symbolic links by default and I find this a terrible design decision (luckily I didn't remove anything that cannot be restored from VCS). If instructed not to follow the links, then it also doesn't remove them (there is a flag for it in 1.8, but I have to use an older version). So, I had to replace the clean target delete

with exec

one that essentially just launches rm -r

- it's easier than 20+ lines of Ant mumbo-jumbo.

Also, if anyone is going to do something like this: remember to use the -t

option ln

when creating symbolic links to directories. Otherwise, restarting will create another link inside the directory's symbolic links.



It generally works now, but I'm disappointed with Ant. I'm guessing it all comes from Java's missing symbolic link support, but still ...

0


a source


You can put all your JSP files in a folder jsp

and then link that folder to your WEB-INF folder in the forked deployment directory.

Ant has an optical task for creating single symbolic links. The task can create directories of symbolic links, but works by recording what symbolic links are and then later re-creating them later. (For example, you can use a wrapper script to initially create your symlinks in the jsp source, use Ant to write the generated links, which are stored in a text file with the source folder, and then use that text file to recreate the link later.)



http://ant.apache.org/manual/Tasks/symlink.html

+1


a source


A cron task can be configured to browse the source directories of your JSP files and copy them to the target directory on the server. Continuous integration tools do things like this to have assemblies triggered by code review. SourceForge has a server that does this, and CruiseControl is different.

0


a source







All Articles