From de476953dda328d15c04865c9b62403d6d03f031 Mon Sep 17 00:00:00 2001 From: pua4io5sn <1054769655@qq.com> Date: Tue, 9 Nov 2021 10:24:44 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' into master --- code/code.iml | 41 ++++++++++++++++ code/home | 1 - code/pom.xml | 49 +++++++++++++++++++ .../java/com/example/code/HelloServlet.java | 27 ++++++++++ code/src/main/webapp/WEB-INF/web.xml | 6 +++ code/src/main/webapp/index.jsp | 13 +++++ doc/userstory.md | 2 +- 7 files changed, 137 insertions(+), 2 deletions(-) create mode 100644 code/code.iml delete mode 100644 code/home create mode 100644 code/pom.xml create mode 100644 code/src/main/java/com/example/code/HelloServlet.java create mode 100644 code/src/main/webapp/WEB-INF/web.xml create mode 100644 code/src/main/webapp/index.jsp diff --git a/code/code.iml b/code/code.iml new file mode 100644 index 0000000..be30588 --- /dev/null +++ b/code/code.iml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/code/home b/code/home deleted file mode 100644 index bd41cba..0000000 --- a/code/home +++ /dev/null @@ -1 +0,0 @@ -12345 \ No newline at end of file diff --git a/code/pom.xml b/code/pom.xml new file mode 100644 index 0000000..a895984 --- /dev/null +++ b/code/pom.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + + com.example + code + 1.0-SNAPSHOT + code + war + + + 1.8 + 1.8 + 5.7.1 + + + + + javax.servlet + javax.servlet-api + 4.0.1 + provided + + + org.junit.jupiter + junit-jupiter-api + ${junit.version} + test + + + org.junit.jupiter + junit-jupiter-engine + ${junit.version} + test + + + + + + + org.apache.maven.plugins + maven-war-plugin + 3.3.1 + + + + \ No newline at end of file diff --git a/code/src/main/java/com/example/code/HelloServlet.java b/code/src/main/java/com/example/code/HelloServlet.java new file mode 100644 index 0000000..6d2fd70 --- /dev/null +++ b/code/src/main/java/com/example/code/HelloServlet.java @@ -0,0 +1,27 @@ +package com.example.code; + +import java.io.*; +import javax.servlet.http.*; +import javax.servlet.annotation.*; + +@WebServlet(name = "helloServlet", value = "/hello-servlet") +public class HelloServlet extends HttpServlet { + private String message; + + public void init() { + message = "Hello World!"; + } + + public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { + response.setContentType("text/html"); + + // Hello + PrintWriter out = response.getWriter(); + out.println(""); + out.println("

" + message + "

"); + out.println(""); + } + + public void destroy() { + } +} \ No newline at end of file diff --git a/code/src/main/webapp/WEB-INF/web.xml b/code/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..d80081d --- /dev/null +++ b/code/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/code/src/main/webapp/index.jsp b/code/src/main/webapp/index.jsp new file mode 100644 index 0000000..19b3ba6 --- /dev/null +++ b/code/src/main/webapp/index.jsp @@ -0,0 +1,13 @@ +<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> + + + + JSP - Hello World + + +

<%= "Hello " %> +

+
+Hello Servlet + + \ No newline at end of file diff --git a/doc/userstory.md b/doc/userstory.md index c674919..4c47309 100644 --- a/doc/userstory.md +++ b/doc/userstory.md @@ -5,4 +5,4 @@ 4. 用户,进入网页后可以点击题库,选择题库中的问题,在代码块中进行回答,选择语言、单击提交后会得到一个结果,便于用户了解算法的正误。 5. 用户,在用户无法解决问题时,可以点击页面右方的题解,进入题解页面,了解到问题的具体解决方法。 6. 用户,进入网站首页后可以通过选择课程学习算法知识,且可以在同页面下查看并选择系统推荐的课程,让学习到的知识体系化,丰富知识面。 -7. 出题人,管理员赋予出题人角色,出题人提供算法题目,题解,解题思路等内容,提交申请等待管理员审核通过。 \ No newline at end of file +7. 出题人,管理员赋予,出题人角色,出题人提供算法题目,题解,解题思路等内容,提交申请等待管理员审核通过。 \ No newline at end of file