I don't think the following code works, it doesn't when I run my version of it.

The loginPage has it's nextPageLink property set, but then the loginPageLink is 
returned by using the Login.class which presumably just redirects to a fresh 
login page without the nextPageLink set.

So the nextPageLink is null in the Login page so the nextPageLink cannot be 
used.

John

http://jumpstart.doublenegative.com.au/jumpstart/examples/infrastructure/protectingpages


            // Get the Login page, give it a link to the requested page, and 
redirect to Login

            IIntermediatePage loginPage = (IIntermediatePage) 
componentSource.getPage(Login.class);

            Link requestedPageLink = makeLinkToRequestedPage(requestedPageName, 
eventContext);
            loginPage.setNextPageLink(requestedPageLink);

            Link loginPageLink = 
pageRenderLinkSource.createPageRenderLink(Login.class);
            response.sendRedirect(loginPageLink);

            return false;

Reply via email to