![]() |
Модераторы: LSD, AntonSaburov |
![]() ![]() ![]() |
|
sergei |
|
|||
Unregistered |
![]() |
|||
|
||||
AntonSaburov |
|
|||
![]() Штурман ![]() ![]() ![]() ![]() Профиль Группа: Модератор Сообщений: 5658 Регистрация: 2.7.2002 Где: Санкт-Петербург Репутация: 51 Всего: 118 |
Когда-то я искал ответ на этот вопрос, но скажу честно, потом не потребовалось. Потому правильност не проверял. Ну а ответ вот такой:
Here's a clever trick: use a redirect. Drop a cookie on the HttpServletResponse object, then call response.sendRedirect() to a "phase two" servlet. The "phase two" servlet then tests whether the cookie was sent back to it. If so, that means the user accepted the cookie the first time; if not, it means that either the client rejected the cookie, or the browser doesn't support cookies. Note that this technique only works if the "phase two" servlet is hidden from the user; if the user can jump directly to the test phase, then the servlet can't tell the difference between newly-arrived clients and cookie-unfriendly clients. That means you should send a redirect from the test phase, to make sure the user doesn't have a chance to bookmark the test phase's URL. Alex Chaffee (http://www.stinky.com/alex/, [email protected]) has written a Servlet that demonstrates this technique called CookieDetector (http://www.purpletech.com/code/CookieDetector.html) See also http://www.jguru.com/jguru/faq/view.jsp?EID=138297 |
|||
|
||||
Unregistered |
|
|||
Unregistered |
Спасибо
|
|||
|
||||
AntonSaburov |
|
|||
![]() Штурман ![]() ![]() ![]() ![]() Профиль Группа: Модератор Сообщений: 5658 Регистрация: 2.7.2002 Где: Санкт-Петербург Репутация: 51 Всего: 118 |
Да вообщем для этого форум и существует.
Заходите к нам почаще - будем рады. |
|||
|
||||
![]() ![]() ![]() |
Правила форума "Java" | |
|
Если Вам помогли, и атмосфера форума Вам понравилась, то заходите к нам чаще! С уважением, LSD, AntonSaburov, powerOn, tux, javastic. |
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей) | |
0 Пользователей: | |
« Предыдущая тема | Java: Общие вопросы | Следующая тема » |
|
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности Powered by Invision Power Board(R) 1.3 © 2003 IPS, Inc. |