-
Notifications
You must be signed in to change notification settings - Fork 1
TS-13 web (jsp) #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
TS-13 web (jsp) #10
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package app.servlets; | ||
|
|
||
| import javax.servlet.RequestDispatcher; | ||
| import javax.servlet.ServletException; | ||
| import javax.servlet.http.HttpServlet; | ||
| import javax.servlet.http.HttpServletRequest; | ||
| import javax.servlet.http.HttpServletResponse; | ||
| import java.io.IOException; | ||
|
|
||
| public class QuestionServlet extends HttpServlet { | ||
| protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
|
|
||
| } | ||
|
|
||
| protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
| RequestDispatcher requestDispatcher = request.getRequestDispatcher("pages/question.jsp"); | ||
| requestDispatcher.forward(request, response); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package app.servlets; | ||
|
|
||
| import javax.servlet.RequestDispatcher; | ||
| import javax.servlet.ServletException; | ||
| import javax.servlet.http.HttpServlet; | ||
| import javax.servlet.http.HttpServletRequest; | ||
| import javax.servlet.http.HttpServletResponse; | ||
| import java.io.IOException; | ||
|
|
||
| public class SingInServlet extends HttpServlet { | ||
| protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
|
|
||
| } | ||
|
|
||
| protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
| RequestDispatcher requestDispatcher = request.getRequestDispatcher("pages/singin.jsp"); | ||
| requestDispatcher.forward(request, response); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| package app.servlets; | ||
|
|
||
| import javax.servlet.RequestDispatcher; | ||
| import javax.servlet.ServletException; | ||
| import javax.servlet.http.HttpServlet; | ||
| import javax.servlet.http.HttpServletRequest; | ||
| import javax.servlet.http.HttpServletResponse; | ||
| import java.io.IOException; | ||
|
|
||
| public class TestScoreServlet extends HttpServlet { | ||
| protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
|
|
||
| } | ||
|
|
||
| protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
| RequestDispatcher requestDispatcher = request.getRequestDispatcher("pages/test_score.jsp"); | ||
| requestDispatcher.forward(request, response); | ||
| } | ||
| } | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package app.servlets; | ||
|
|
||
| import javax.servlet.RequestDispatcher; | ||
| import javax.servlet.ServletException; | ||
| import javax.servlet.http.HttpServlet; | ||
| import javax.servlet.http.HttpServletRequest; | ||
| import javax.servlet.http.HttpServletResponse; | ||
| import java.io.IOException; | ||
|
|
||
| public class TestServlet extends HttpServlet { | ||
| protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
|
|
||
| } | ||
|
|
||
| protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
| RequestDispatcher requestDispatcher = request.getRequestDispatcher("pages/test.jsp"); | ||
| requestDispatcher.forward(request, response); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package app.servlets; | ||
|
|
||
| import javax.servlet.RequestDispatcher; | ||
| import javax.servlet.ServletException; | ||
| import javax.servlet.http.HttpServlet; | ||
| import javax.servlet.http.HttpServletRequest; | ||
| import javax.servlet.http.HttpServletResponse; | ||
| import java.io.IOException; | ||
|
|
||
| public class profile_student_Servlet extends HttpServlet { | ||
| protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
|
|
||
| } | ||
|
|
||
| protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
| RequestDispatcher requestDispatcher = request.getRequestDispatcher("pages/profile_student.jsp"); | ||
| requestDispatcher.forward(request, response); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,14 +5,14 @@ | |
| <link rel="stylesheet" type="text/css" href="pages/style.css" /> | ||
| </head> | ||
| <body> | ||
| <form> | ||
| <form method="post"> | ||
| <div class="container"> | ||
| <h1>Register</h1> | ||
| <p>Please fill in this form to create an account.</p> | ||
| <hr> | ||
|
|
||
| <label for="email"><b>Email</b></label> | ||
| <input type="text" placeholder="Enter Email" name="email" required> | ||
| <label for="username"><b>Username</b></label> | ||
| <input type="text" placeholder="Enter uername" name="username" required> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please fix typo in the placeholder |
||
|
|
||
| <label for="psw"><b>Password</b></label> | ||
| <input type="password" placeholder="Enter Password" name="psw" required> | ||
|
|
@@ -25,7 +25,7 @@ | |
| </div> | ||
|
|
||
| <div class="container signin"> | ||
| <p>Already have an account? <a href="#">Sign in</a>.</p> | ||
| <p>Already have an account? <a href="/singin">Sign in</a>.</p> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please implement the POST method for Sign-in servlet or put a mock-up (fake until you make it). |
||
| </div> | ||
| </form> | ||
| </body> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| <%@ page contentType="text/html;charset=UTF-8" language="java" %> | ||
| <html> | ||
| <head> | ||
| <title>Profile</title> | ||
| </head> | ||
| <body> | ||
| <section class="user"> | ||
| <div class="container"> | ||
| <p>Иван Иванович Иванов</p> | ||
| <p>Студент группы ХХХХХХ</p> | ||
| </div> | ||
| </section> | ||
| <section class="tests"> | ||
| <div class="container"> | ||
| <p>Доступные для прохождения тесты:</p> | ||
| <ul> | ||
| <li><a href="/test"> Тест 1</a></li> | ||
| <li><a href="/test"> Тест 2</a></li> | ||
| </ul> | ||
| <p> Пройденные тесты:</p> | ||
| <table> | ||
| <tr> | ||
| <td>Тест</td> | ||
| <td>Процент выполнения</td> | ||
| </tr> | ||
| <tr> | ||
| <td>Тест 3</td> | ||
| <td>66%</td> | ||
| </tr> | ||
| <tr> | ||
| <td>Тест 4</td> | ||
| <td>87%</td> | ||
| </tr> | ||
| </table> | ||
| </div> | ||
| </section> | ||
|
|
||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| <%-- | ||
| Created by IntelliJ IDEA. | ||
| User: bozhk | ||
| Date: 07.07.2020 | ||
| Time: 16:05 | ||
| To change this template use File | Settings | File Templates. | ||
| --%> | ||
| <%@ page contentType="text/html;charset=UTF-8" language="java" %> | ||
| <html> | ||
| <head> | ||
| <title>Question</title> | ||
| </head> | ||
| <body> | ||
| <div class="container"> | ||
| <p>Текст вопроса</p> | ||
| <form> | ||
| <p><b>Какое у вас состояние разума?</b></p> | ||
| <p><input name="dzen" type="radio" value="nedzen"> Не дзен</p> | ||
| <p><input name="dzen" type="radio" value="dzen"> Дзен</p> | ||
| <p><input name="dzen" type="radio" value="pdzen" checked> Полный дзен</p> | ||
| <p><input type="submit" value="Выбрать"></p> | ||
| </form> | ||
| </div> | ||
| <div class="container"> | ||
| <p>Пройдено:</p> <p>(здесь процесс прохождения)</p> | ||
| </div> | ||
| <div class="container"> | ||
| <button><a href="/test_score">Завершить</a></button> | ||
| </div> | ||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| <%@ page contentType="text/html;charset=UTF-8" language="java" %> | ||
| <html> | ||
| <head> | ||
| <title>Регистрация</title> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please be consistent with the used language (don't mix Russian and English). All the fields that are language-sensitive can be set up using different locales. Since the project doesn't provide the "language change" option, it would be better to stick with only one language. |
||
| <link rel="stylesheet" type="text/css" href="pages/style.css" /> | ||
| </head> | ||
| <body> | ||
| <form method="post"> | ||
| <div class="container"> | ||
| <h1>Sing in</h1> | ||
| <p>Please fill in this form to sing in account.</p> | ||
| <hr> | ||
|
|
||
| <label for="username"><b>Username</b></label> | ||
| <input type="text" placeholder="Enter uername" name="username" required> | ||
|
|
||
| <label for="psw"><b>Password</b></label> | ||
| <input type="password" placeholder="Enter Password" name="psw" required> | ||
|
|
||
| <button type="submit" class="singinbtn"><a href="/profile_student">Sing in</a></button> | ||
| </div> | ||
|
|
||
| </form> | ||
| </body> | ||
| </html> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| <%-- | ||
| Created by IntelliJ IDEA. | ||
| User: bozhk | ||
| Date: 07.07.2020 | ||
| Time: 16:05 | ||
| To change this template use File | Settings | File Templates. | ||
| --%> | ||
| <%@ page contentType="text/html;charset=UTF-8" language="java" %> | ||
| <html> | ||
| <head> | ||
| <title>Test</title> | ||
| </head> | ||
| <body> | ||
| <div class="container"> | ||
| <button><a href="/question">Start</a></button> | ||
| </div> | ||
| <div class="container"> | ||
| <p>Время на прохождение теста:</p> | ||
| <p>(тут должно быть время)</p> | ||
| </div> | ||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| <%-- | ||
| Created by IntelliJ IDEA. | ||
| User: bozhk | ||
| Date: 07.07.2020 | ||
| Time: 16:17 | ||
| To change this template use File | Settings | File Templates. | ||
| --%> | ||
| <%@ page contentType="text/html;charset=UTF-8" language="java" %> | ||
| <html> | ||
| <head> | ||
| <title>Test score</title> | ||
| </head> | ||
| <body> | ||
| <div class="container"> | ||
| <p>Вы прошли тест ХХХ</p> | ||
| <p>Ваш итог: (процент выполнения теста)</p> | ||
| </div> | ||
| <div class="container"> | ||
| <button><a href="/profile_student">Вернуться в профиль</a></button> | ||
| </div> | ||
| </body> | ||
| </html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible simplification: All these descriptions could be replaced by
@WebServlet("/YOUR_PATH")annotation above the Servlet class (import javax.servlet.annotation.WebServlet.