I've got the following in a tiles layout file. It checks for the user (in a user credential in the session) having rights set in the tiles config file. If the user does not have the required rights, they are sent back to the home page.
<%-- Make the tiles "rightsRequired" variable available in the current scope --%> <tiles:useAttribute name="rightsRequired" classname="java.lang.String"/> <%-- Are any "rightsRequired"? --%> <logic:notEqual name="rightsRequired" value=""> <%-- Does the user NOT have the required rights? --%> <rights:notHasRights rights="<%= rightsRequired %>"> <%-- Redirect to the home page --%> <logic:redirect forward="home"/> </rights:notHasRights> </logic:notEqual> What I would like to do, is cause an error message to be output when this occurs. I tried something like this, but it doesn't work. Maybe every tile has a different request object? <%-- Make the tiles "rightsRequired" variable available in the current scope --%> <tiles:useAttribute name="rightsRequired" classname="java.lang.String"/> <%-- Are any "rightsRequired"? --%> <logic:notEqual name="rightsRequired" value=""> <%-- Does the user NOT have the required rights? --%> <rights:notHasRights rights="<%= rightsRequired %>"> <%-- Put a message into the request for the next page to display --%> <% ActionErrors errors = new ActionErrors(); errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("error.rights")); request.setAttribute(Action.ERROR_KEY, errors); %> <%-- Redirect to the home page --%> <logic:redirect forward="home"/> </rights:notHasRights> </logic:notEqual> I've tried putting the error message in the session, instead of the request, and while that works, I'd have to go and remove the error or it sticks around to be displayed on every page :P Is there another way to do this? -- Steve Stair [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]