Project

General

Profile

Download (1.43 KB) Statistics
| Branch: | Revision:

git_sitools_idoc / flarecast / workspace / libraries / fr.cnes.sitools.captcha_1.0 / test / src / fr / cnes / sitools / captcha / CaptchaUtil.java @ master

1
 /*******************************************************************************
2
 * Copyright 2010-2014 CNES - CENTRE NATIONAL d'ETUDES SPATIALES
3
 *
4
 * This file is part of SITools2.
5
 *
6
 * SITools2 is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation, either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * SITools2 is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with SITools2.  If not, see <http://www.gnu.org/licenses/>.
18
 ******************************************************************************/
19
package fr.cnes.sitools.captcha;
20

    
21
public class CaptchaUtil {
22

    
23
        
24
//        import="nl.captcha.Captcha" %>
25
//
26
//        <% 
27
//        // We're doing this in a JSP here, but in your own app you'll want to put
28
//        // this logic in your MVC framework of choice.
29
//
30
//        Captcha captcha = (Captcha) session.getAttribute(Captcha.NAME);
31
//        request.setCharacterEncoding("UTF-8"); // Do this so we can capture non-Latin chars
32
//        String answer = request.getParameter("answer");
33
//        if (captcha.isCorrect(answer)) { %>
34
//            <b>Correct!</b>
35
//        <% } else { %>
36
//            <b>Wrong!</b>
37
//        <% } %>
38

    
39
}