i have a login form in Struts 2 which has username and password field. what i want is when user submit the form and if it is not a valid user, i want to show the error message in a dialogue box (instead of showing the error message in login form itself). Is there any tag available in struts 2 for this or somebody can point me to similar kind of brief example?
put this in your login page(you are returning here right, on invalid login?)
<script>
<s:if test="hasActionErrors()">
showDialog("<s:actionerror/>");
</s:if>
function showDialog(msg){
//your logic to show dialog goes here
}
</script>
Here is a post which explains how to design a notification similar to stack overflow. You can use this or any other modal dialog, there are many tutorials on how to show a modal dialog
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.