Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > Java программирование > Java для Web (EE, Servlet, JSP, Tomcat, Spring MVC)
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 02.10.2007, 12:21   #1
Anticrim
 
Регистрация: 02.10.2007
Сообщений: 3
Счастье Как передать POST data через запрос в веб-приложение

Вот что мне надо сделать: If the session expires in the admin, then a login screen is shown, this screen should forward to the same location in admin as the original request If a request is made to the Admin application and there is no session associated with that request, then 1. the Admin application should pass the whole URL (including GET parameters) of that request to the Admin Login application 2. If the original request contained POST data, this must also be passed to the Login application 3. If a request to the Login application contains URL and POST data, then Login should pass this data back to the Admin application 4. If User is logged on to the Admin application, and the login request contains URL and POST data, then the data should be posted to that URL on behalf of the user. что бы URL сохранялся , я сделал(ну помогли =) ) Как быть с пост датой не знаю, по русски примерно так, допустим работаешь ты в админской части программы, ввел данные , нажал субмит, а твоя сессия закончилась и ты вылетел в логин пейдж, после того как ты залогинился, надо что тебя кинуло на ту же страничку( сделано) и в форме были те же данные , которые ты хотел ввести. Подсказки приветсвуются )
Anticrim вне форума Ответить с цитированием
Старый 02.10.2007, 14:03   #2
Fox
линуксоид
Форумчанин
 
Аватар для Fox
 
Регистрация: 02.11.2006
Сообщений: 157
По умолчанию

Код в студию!
Fox вне форума Ответить с цитированием
Старый 02.10.2007, 14:43   #3
Anticrim
 
Регистрация: 02.10.2007
Сообщений: 3
По умолчанию

//LoginForm.java

// Add the URL, where user wants to be redirected after logging in, to the Login request

if (request.getParameter("redirect") != null) {
logger.error("Setting redirect URL: " + request.getParameter("redirect"));
template.setVariable("redirect", Utils.htmlentities(request.getParam eter("redirect")));


//LoginForm.html
<input type="hidden" name="redirect" value="$redirect$">



//SessionStopper.java

import org.apache.log4j.Logger;

private static final Logger logger = Logger.getLogger(SessionStopper.cla ss);

if (request.getParameter("redirect") != null) {
if (query.length() > 0) {
query.append("&");
} else {
query.append("?");
}
query.append("redirect=" + request.getParameter("redirect"));
}
logger.error("Setting redirect URL: " + request.getParameter("redirect"));


//SessionStarter.java

import org.apache.commons.codec.binary.Bas e64;
import org.apache.log4j.Logger;

private static final Logger logger = Logger.getLogger(SessionStarter.cla ss);

if (
request.getParameter("redirect") != null
&& Base64.isArrayByteBase64(request.ge tParameter("redirect").getBytes())
) {
String redirect = new String(
Base64.decodeBase64(
request.getParameter("redirect").ge tBytes()
)
);
logger.error("Setting redirect URL: " + redirect);
response.sendRedirect(redirect);
} else {
response.sendRedirect(WorkspaceDefa ults.getAdminRoot() + "Index");
}

часть кода отвечающая за сохранение урл
Anticrim вне форума Ответить с цитированием
Старый 03.10.2007, 18:19   #4
Anticrim
 
Регистрация: 02.10.2007
Сообщений: 3
По умолчанию

все, понял, всем спасибо )
Anticrim вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск


Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Post запрос с помощью Webrowser eldar Работа с сетью в Delphi 0 28.08.2008 17:33
post запрос Editor Работа с сетью в Delphi 4 20.04.2008 14:01
Работа через POST с html (помощь) key' Работа с сетью в Delphi 5 16.08.2007 15:03
Поиск через запрос Таня84 БД в Delphi 1 17.02.2007 02:52
КАК ОТКРЫТЬ ЛЮБОЕ ПРИЛОЖЕНИЕ ЧЕРЕЗ DELPHI??? micaell Общие вопросы Delphi 8 17.12.2006 20:05