로그인 후 사용자를 리디렉션하려고한다고 가정합니다.
이것 좀보세요. 트릭을해야 할 것입니다. 클래스를 번들에 놓고 논리를 조정하십시오.
@Component(
immediate = true,
property = {
"key=login.events.post"
},
service = LifecycleAction.class
)
public class LandingPageRouter implements LifecycleAction {
private static Log LOG = LogFactoryUtil.getLog(LandingPageRouter.class);
@Reference
private UserLocalService userLocalService;
@Override
public void processLifecycleEvent(LifecycleEvent lifecycleEvent) throws ActionException {
//Do some magic
//build the path.
LastPath lastPath = new LastPath(StringPool.BLANK, path);
lifecycleEvent.getRequest().getSession().setAttribute(WebKeys.LAST_PATH, lastPath);
}
}
LastPath는 DefaultLandingPageAction에서와 같이 작동합니다.
안녕 Miroslav, 도움에 감사드립니다. 예, 로그인 후 특정 페이지로 사용자를 리디렉션하려고했습니다. LifecycleAction을 구현하는 대신 Action 이벤트를 확장하려고했습니다. 이것은 나를 위해 일했습니다. 감사 – Dipti