Sam,

You can get a context relative path in your RequestProcessor processRoles
function by doing something like this:

// Retain the http or https used in this call using getScheme()
String redirect = (String) request.getScheme() + "://"
                + request.getHeader("host")
                + request.getContextPath()
                + request.getServletPath()
                + mapping.findForward("login").getPath();

response.sendRedirect(redirect);
return (false);

If your global forward were "login" with the path "/login.jsp", you would
get something like http://somehost/appname/login.jsp";.  Just replace "login"
with your appropriate global-forward name.  It also works with /do and *.do
names (I'm using /do/* in Struts v1.1, myself).

Because the above is an external redirect like redirect="true"), this
probably won't work if your global forward is a tile OR if your global
forward is a redirect="true" OR if your global forward is a protected
directory like /WEB-INF/pages/somepage.jsp.

Regards,
David


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to