|
|
|
java jsp:forward перенаправление на главную страницу.
|
|||
|---|---|---|---|
|
#18+
Доброго времени суток! не могу разобраться. Есть структура проекта веб-приложения index.html <!DOCTYPE html> <html> <head> <title>HELLO</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" href="styles/style.css" type="text/css"/> </head> <body> <div id="headPage"> <p id="mainInfo">Вход не выполнен. <a href="sources/login.html" class="goLogin" id="goLoginId">войдите</a> или <a href="#" class="goLogin" id="goRegId">зарегестрируйтесь</a></p> </div> <div id="enterPage"></div> <div id="aboutPage"> </div> </body> </html> Переходя по ссылке пользователь попадает http://localhost:8080/WebApplication1/sources/login.html <html> <head> <title>login</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" href="../styles/style.css" type="text/css"/> </head> <body> <form id="loginForm" action="login.jsp" name="loginForm" method="get"> <div class="field"> <label>Имя пользователя:</label> <div class="input"><input type="text" name="userName" placeholder="Enter your name" value=""/></div> </div> <div class="field"> <label>Пароль:</label> <div class="input"><input type="password" name="userPass" placeholder="Enter your password" value=""/></div> </div> <div class="submit"> <button type="submit">Войти</button> <label id="remember"><input name="" type="checkbox" value="Отправить" /> Запомнить меня</label> </div> </form> </body> </html> и в случае успешной регистрации хотелось бы перенаправить его обратно домой http://localhost:8080/WebApplication1 <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri=" http://java.sun.com/jsp/jstl/core" %> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Login</title> </head> <body> <jsp:useBean id="loginHandler" class="registration.LoginBean" scope="request"> <jsp:setProperty name="loginHandler" property="*"/> </jsp:useBean> <% if (loginHandler.validate()) { %> <jsp:forward page="/WebApplication1"/> <% } else { %> <jsp:forward page="retryLogin.jsp"/> <% } %> </body> </html> помогите пожалуйста новичку! Буду благодарен) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 07.12.2013, 04:42:56 |
|
||
|
|

start [/forum/topic.php?fid=59&fpage=196&tid=2128035]: |
0ms |
get settings: |
7ms |
get forum list: |
14ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
62ms |
get topic data: |
10ms |
get forum data: |
2ms |
get page messages: |
20ms |
get tp. blocked users: |
1ms |
| others: | 242ms |
| total: | 364ms |

| 0 / 0 |
