jQuery in Action, 3rd edition
The moose likes Servlets and the fly likes File root config problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "File root config problem" Watch "File root config problem" New topic

File root config problem

Anthony Smith
Ranch Hand

Joined: Sep 10, 2001
Posts: 285
Let's say I got a server http://mydomain.com
Annd I have a page http://mydomain.com/forms/new/add.jsp that posts to a servlet
In my servlet I have
getServletContext().getRequestDispatcher(viewTemplate).forward(req, res);
where viewTemplate = "/thankyou.jsp"
Now thankyou.jsp is located here http://mydomain.com/forms/new/thankyou.jsp
Now if I user that forward it tries to look for:
I do nto want to hardcode the /forms/new inside of my viewTemplate, becasue the names of the paths might change, but the structure will still be the same.
How do I code it where it knows to forward to http://mydomain.com/forms/new/thankyou.jsp
and not to http://mydomain.com/thankyou.jsp without hardcoding.
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

check your other post


so, the answer is to use:


and remove the leading '/'
Have you checked out Aspose?
subject: File root config problem
jQuery in Action, 3rd edition