What is your web context root? Is it "/"? Are we talking about a single Struts application or multiple applications? If it's a single application, are there multiple modules? [ August 02, 2006: Message edited by: Merrill Higginson ]
But I dont want to forward using absolute path like ActionForward forward = new ActionForward(); forward.setPath("http://www.abc.com/error.html"); forward.setRedirect(true); return forward;
posted 13 years ago
Yes, it's possible to set up a forward to a "root" page like this. It's still considered a forward outside the application, though. Because of this, you cannot use a context relative reference. You must enter the full URL.
One possible workaround, though, would be to use the HttpServletReqeust object's getRequestURL() method to get the URL sent to the web container to reach the current action. You could easily develop a utility that would parse through this String, extract the server portion of the URL, and append it to the relative path you might send in as a parameter.