mirror of
https://github.com/ZSCNetSupportDept/WechatTicketSystem.git
synced 2025-10-28 23:55:04 +08:00
52 lines
2.1 KiB
Java
52 lines
2.1 KiB
Java
/*
|
|
* This file is part of WechatTicketSystem.
|
|
*
|
|
* WechatTicketSystem is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU Lesser General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* WechatTicketSystem is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
* along with WechatTicketSystem. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
package love.sola.netsupport;
|
|
|
|
import javax.servlet.ServletException;
|
|
import javax.servlet.annotation.WebServlet;
|
|
import javax.servlet.http.HttpServlet;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import java.io.IOException;
|
|
import java.io.PrintWriter;
|
|
|
|
/**
|
|
* @author Sola {@literal <dev@sola.love>}
|
|
*/
|
|
@WebServlet(name = "Index", urlPatterns = "/index", loadOnStartup = 1)
|
|
public class Index extends HttpServlet {
|
|
|
|
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
|
doGet(request, response);
|
|
}
|
|
|
|
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
|
request.setCharacterEncoding("utf-8");
|
|
response.addHeader("Content-type", "text/plain;charset=utf-8");
|
|
response.setCharacterEncoding("utf-8");
|
|
PrintWriter out = response.getWriter();
|
|
out.println("Wechat Ticket System (WTS) 0.1 Copyright 2015-2016 Sola & LiuYue all rights reserved. | Commercial license for ZSC Network Support Department (ZSCNSD).");
|
|
out.println("For any problem, Please contact loli@sola.love.");
|
|
if (response.getStatus() == HttpServletResponse.SC_NOT_FOUND) {
|
|
out.println("\nError 404: Page not found.");
|
|
}
|
|
out.close();
|
|
}
|
|
|
|
}
|