First, you create your own custom HTML form for the user login (although this can certainly be generated by aJSP). Then you create a custom HTML error page .