<script>
Window. The onl oad=function () {
Document. The getElementById (" img "). The onclick=function () {
This. SRC="https://bbs.csdn.net/day16/checkCodeServlet? Time="+ new Date (). GetTime ();
}
}
</script>
<style>
Div {
color: red;
}
</style>
<body>
The user name & lt;/td> | |
Password & lt;/td> | |
Verification code & lt;/td> | |
| |
|
<% -- --
If incorrect authentication code or the user name password, login. JSP need to decide what is the error and the output message
Here you can use JSP script & lt; %=% & gt; To output tip
- % & gt;
<% -- --
Judge whether the "login_error" attribute of the Request the domain is empty, don't print it is empty, the same as the following cc_error null will print "" won't show so redundant information
JSP output script can't write the if - else, we can use the ternary operator? Judging:
- % & gt;
<%=request. The getAttribute (" login_error ")==null? "" : the request. The getAttribute (" login_error") % & gt;
<%=request. The getAttribute (" cc_error ")==null? "" : the request. The getAttribute (" cc_error") % & gt;