I'm quite new to java web page environment. Recently I try to develop an E-Business platform by using Java.
Hence, I'm using j_security_check Form-Based as my authentication tool. It was successfully to re-direct to desire page after authentication completed.
However, due to I have to load end user setting and information from Database (MS SQL 2005), so I have to load all the information after authentication completed and before page re-direct.
I had tried some method by using primefaces but it was unable to trigger the bean method that load user information.
One of the methods that I tried is using oncomplete to trigger the bean method
<h:form id="login" prependId="false"
onsubmit="document.getElementById('login').action='j_security_check';">
<h:panelGrid columns="2" cellpadding="5">
<h:outputLabel for="j_username" value="Username:" />
<p:inputText value="#{loginBean.username}"
id="j_username" required="true" label="j_username" />
<h:outputLabel for="j_password" value="Password:" />
<h:inputSecret value="#{loginBean.password}"
id="j_password" required="true" label="j_password" />
<f:facet name="footer">
<p:commandButton id="loginButton" value="Login" type="submit" ajax="false"
oncomplete="#{loginBean.login()}"/>
</f:facet>
</h:panelGrid>
</h:form>
I also been tried something similar to this which just change oncomplete to onclick and others. End up doesn't has any method is workable.
Hence, I hope that anyone of you can give me advise how should I overcome this problem.
Million thanks,