1.新增驗證碼
application Controller新增captcha()
public static void captcha() {
Images.Captcha captcha = Images.captcha();
rages.Captcha captcha = Images.captcha();? Route
GET /captcha cha
驗證碼圖片已經實現了,現在需要做的是驗證輸入資訊與驗證碼一致
Images.Captcha captcha = Images.captcha(); String code = captcha.getText("#E4EAFD"); code, "10mn"); renderBinary(captcha);
} omID = Codec.UUID();
render(post, randomID);
}
lab code">Please type the code below:
="submit" value="Submit your comment" />
2.驗證
vpostComment or is required") String author,
@Required(message="A message is required") String content,
@Required(message="Please type the code") String code,
String randomId) {
post. findById(postId);
validation.equals(code, Cache.get(randomId)).message("Invalid code. Please type it again");
has it again");
我show.html", post);
}
}
修改show.html頁
#{ifErrors}
c
#{/ifErrors}
以上就是PlayFramework完整實現一個APP(七)的內容,更多相關內容請關注PHP中文網(www.php.cn)!

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章

熱工具

VSCode Windows 64位元 下載
微軟推出的免費、功能強大的一款IDE編輯器

記事本++7.3.1
好用且免費的程式碼編輯器

MinGW - Minimalist GNU for Windows
這個專案正在遷移到osdn.net/projects/mingw的過程中,你可以繼續在那裡關注我們。 MinGW:GNU編譯器集合(GCC)的本機Windows移植版本,可自由分發的導入函式庫和用於建置本機Windows應用程式的頭檔;包括對MSVC執行時間的擴展,以支援C99功能。 MinGW的所有軟體都可以在64位元Windows平台上運作。

WebStorm Mac版
好用的JavaScript開發工具

SublimeText3 Linux新版
SublimeText3 Linux最新版