Exemplo n.º 1
0
 private void conditionallySetLoginCallback(LoginPage login, IPage page, IRequestCycle cycle) {
   // If page service is calling page, you're probably logged out and user could be
   // looking at a very different page then what gets interpretted from this callback
   // because all session data is lost.
   //
   // If your page can safely handle this, consider refactoring border component to accept a
   // component parameter to circumvent this constraint. Warning: this means your page
   // either doesn't use session variabled OR can safely recover when session is lost
   //
   String serviceName = cycle.getService().getName();
   if (Tapestry.EXTERNAL_SERVICE.equals(serviceName)) {
     ICallback callback =
         new ExternalCallback((IExternalPage) page, cycle.getListenerParameters());
     login.setCallback(callback);
   }
 }