Cordenier Christophe a écrit :
In fact, this is a better solution if you have an activation context.

So to achieve this, we still may use the "ComponentResources" class and its 
"createPageLink" method

Christophe.
Thanks all, it works great now :

  @ApplicationState
  private SimExplorerState applicationState;

   @Inject
   private ComponentResources resources;

  Object onActivate(Object... pageContext) throws SimExplorerException {
      [...]
      if (!userLogged) {
           applicationState.setPageName(resources.getPageName());
           applicationState.setPageContext(pageContext);
          return "Login"; // redirect to login page
      }
      [...]
      return null;
  }

Then in Login :

public Object onSuccessFromFormLogin() throws SimExplorerException, IOException {
      [...]
      if (success) {
[...] String fromPage = applicationState.getPageName();
           if (fromPage == null) {
               return elementList;
           }
return resources.createPageLink(applicationState.getPageName(), true, applicationState.getPageContext());
      }
      return this;
  }

--
Gabriel <[EMAIL PROTECTED]>
http://www.codelutin.com
tel : 02 40 50 29 28 / fax : 09 59 92 29 28


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

Reply via email to