On Thu, 28 Nov 2002 04:33, you wrote:
> Hi,
>
> I am securing my screens with the method isAuthorized() which
> includes the following code:
>       if (!isAuthorized)
>          {
>               data.setScreenTemplate("AccessNotAllowed.vm");
>               data.setScreen("AccessNotAllowed");
>          }
>       return isAuthorized;

Is this above code in your Action or your Screen class?  You shouldn't 
ever need to call data.setScreen(), you should only ever need to call 
data.setScreenTemplate().

> This will lead the user to the new screen but the correspondending
> java code in "AccessNotAllowed.class" (which is setting some text in 
> the proper language) is not executed.

Usually, only one Screen class is executed for each request.  
data.setScreenTemplate() is used when you want to short circuit an 
Action or Screen and change the template that will be executed next.  
If calling this from a Screen class, the current context will be 
applied to the next template that is executed.

If you want to have the doBuildTemplate() method executed for the 
Screen you are taking the user to, then you should use the doRedirect()
method.  doRedirect() essentially allows you to stop execution in one 
Screen and instantly execute another Screen.  If you have anything 
added in the context, it will get carried over.

Hope that helps,

-- Rodney

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

Reply via email to