Servlet开发:安全与部署全解析
1. 留言簿Servlet示例
首先来看一个留言簿Servlet的示例代码:
/** Name des Eintragenden */
protected String myName;
/** E-Mail-Adresse des Eintragenden */
protected String myEmail;
/** Kommentar */
protected String myComment;
/** Erstellungsdatum */
protected Date myCreationDate;
/** No-Arg-Konstruktor */
public GuestbookEntry() {}
public GuestbookEntry(String name, String email, String comment) {
if (name == null) throw new IllegalArgumentException();
myName = name;
if (email == null) throw new IllegalArgumentException();
if (email.indexOf("@") == -1) throw new IllegalArgumentException();
myEmail = email;
if (comment == null) throw new IllegalArgumentException();
myComment = comment;
myCreationDate = n
订阅专栏 解锁全文
1385



被折叠的 条评论
为什么被折叠?



