reset password
Author Message
jhodges
Posts: 16
Posted 06:17 Oct 10, 2014 |

Will the date need to referenced by its respective import? After all, class will end before the year does -- as it were.

 

~~Regards,

Joseph Hodges
==============================
Joseph G. Hodges
CSULA Computer Science student
Cryptography I CourseRA student
Quantum Computing enthusiast
Johnny A. Wheeler's "it from bit"
Email: cryptomath@hotmail.com
Phone: 310.538.8294 (Preferred)
==============================

Last edited by jhodges at 06:18 Oct 10, 2014.
cysun
Posts: 2935
Posted 07:25 Oct 10, 2014 |

I don't understand the question.

For pre-created log entries (for testing purpose), any past date would do. For new log entries, the date borrowed and date returned are always the "current date" when the operation is performed. To get current date you can use java.util.Date or java.util.Calendar.

Last edited by cysun at 07:25 Oct 10, 2014.
cysun
Posts: 2935
Posted 13:14 Oct 10, 2014 |

For formatting dates, you may want to use SimpleDateFormat.
 

jhodges
Posts: 16
Posted 10:23 Oct 11, 2014 |

Duely noted. Thanks Professor Sun.

The next question that I seem to be running into, is to use .html, .htm, or .jsp's to produce our inputs. Is that Homework_3 (with extra goodies of course) -- or are we still appending to a stringbuffer and therefore using printwriter from the response? Perhaps, these are easy fixes..

For example, part 4 of homework_2 indicates, " i.e. you cannot use JavaScript to validate username/password on the client sid". I typically use a <script type="text/javascript"> //.... </script> of which gathers and validates input from the user. Since you do not want this to happen, e.g., part 4 of homework_2 my question remains:

 

How do you want  us to vaidate our code if we cannot use javascript?

Looking forward to your reply.

Last edited by jhodges at 10:29 Oct 11, 2014.
cysun
Posts: 2935
Posted 12:49 Oct 11, 2014 |

Starting from Homework 3 you'll be asked to use JSP. For Homework 2 you can only use servlets or a combination of servlets and HTML pages (like the AddForm.html and Add.java example).

As for "i.e. you cannot use JavaScript to validate username/password on the client side", I think "validate" is probably the wrong word to use here - I've changed it to "verify".

Input Validation usually means checking if the user input is in proper form, e.g. whether a field is left empty, whether an email address contains "@", and so on. You can certainly do this on the client side using JavaScript if you want (though it is not required).

User authentication, or in other words, "verify username and password", is to check whether the username and password match what's on record. This has to be done on the server side so it cannot be bypassed. In our case, it means this check needs to be done in servlet code (see Login.java in the Login/Logout/Members example).