views:

552

answers:

2

We currently have an appserver setup where EVERYTHING is off of one big context root, and we copy class files and restart app servers to deploy. Not ideal. I'm trying to set up an ant script to do the build and deploy using wdeploy, and everything works, except I need my servlet to forward to jsps outside of the context root of my war file deploy. So I figure if I can put a symlink in my war file, it can point to somewhere outside of my context root space.

This is the goal I'm trying to achieve, perhaps the symlink isn't the best idea. I just need a way to forward outside of my context root from a servlet.

A: 

I'm not sure a symlink will work and I agree it's not a good idea. Try creating a virtual directory pointing to where your jsps are located.

digitalsanctum
Erm... in what context do you refer to 'virtual directory?' a mountpoint?
stu
A: 

You can always to HttpServletResponse.sendRedirect to send the user anywhere, but if you want to use RequestDispatcher.forward or jsp:forward, it only works within the app's context root.

I don't think it's that bad to have all your code under one context root, assuming it's related to one application. Creating multiple WARs for different parts of the same application seems to increase your maintenance cost with little gain.

davetron5000
The gain is not having to restart tons of webservers.
stu