Commit 2b919df9 by Tuukka Kivilahti

error login redirect is now configurable

1 parent 35b9f5df
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>LanBortalWeb</display-name> <display-name>LanBortalWeb</display-name>
<session-config> <session-config>
<session-timeout>30</session-timeout> <session-timeout>120</session-timeout>
</session-config> </session-config>
<context-param> <context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name> <param-name>javax.faces.PROJECT_STAGE</param-name>
......
...@@ -13,7 +13,7 @@ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/htm ...@@ -13,7 +13,7 @@ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/htm
<ui:define name="content"> <ui:define name="content">
<h1>#{i18n['login.login']}</h1> <h1>#{i18n['login.login']}</h1>
<login:login /> <login:login onError="/admin/adduser/start" />
</ui:define> </ui:define>
</ui:composition> </ui:composition>
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<composite:interface> <composite:interface>
<composite:attribute name="isOneliner" required="false" /> <composite:attribute name="isOneliner" required="false" />
<composite:attribute name="onError" required="false" />
</composite:interface> </composite:interface>
<composite:implementation> <composite:implementation>
...@@ -30,7 +31,7 @@ ...@@ -30,7 +31,7 @@
<h:inputSecret id="gridPwd" value="#{authView.password}" /> <h:inputSecret id="gridPwd" value="#{authView.password}" />
</h:panelGrid> </h:panelGrid>
<h:commandButton id="gridsubmit" actionListener="#{authView.executeLogin()}" value="#{i18n['login.submit']}" /> <h:commandButton id="gridsubmit" actionListener="#{authView.executeLogin(cc.attrs.onError)}" value="#{i18n['login.submit']}" />
</c:otherwise> </c:otherwise>
</c:choose> </c:choose>
......
...@@ -58,8 +58,15 @@ public class AuthView extends GenericCDIView { ...@@ -58,8 +58,15 @@ public class AuthView extends GenericCDIView {
} }
public void executeLogin() { public void executeLogin() {
doLogin("/auth/loginError"); executeLogin(null);
}
public void executeLogin(String onError) {
if(onError == null)
onError = "/auth/loginError";
doLogin(onError);
} }
private void doLogin(String onError) { private void doLogin(String onError) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!