**
Tomcat设置的前端页面出不来
**
26-Jul-2021 14:51:41.907 警告 [main] org.apache.catalina.startup.ClassLoaderFactory.validateFile Problem with directory [C:\Users\fanjj29\.SmartTomcat\servletdemo03\servletdemo03\lib], exists: [false], isDirectory: [false], canRead: [false]
26-Jul-2021 14:51:41.913 警告 [main] org.apache.catalina.startup.ClassLoaderFactory.validateFile Problem with directory [C:\Users\fanjj29\.SmartTomcat\servletdemo03\servletdemo03\lib], exists: [false], isDirectory: [false], canRead: [false]
26-Jul-2021 14:51:41.913 警告 [main] org.apache.catalina.startup.ClassLoaderFactory.validateFile Problem with directory [C:\Users\fanjj29\.SmartTomcat\servletdemo03\servletdemo03\lib], exists: [false], isDirectory: [false], canRead: [false]
26-Jul-2021 14:51:41.913 警告 [main] org.apache.catalina.startup.ClassLoaderFactory.validateFile Problem with directory [C:\Users\fanjj29\.SmartTomcat\servletdemo03\servletdemo03\lib], exists: [false], isDirectory: [false], canRead: [false]
26-Jul-2021 14:51:42.606 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server.服务器版本: Apache Tomcat/8.5.69
26-Jul-2021 14:51:42.607 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 服务器构建: Jun 30 2021 18:00:00 UTC
26-Jul-2021 14:51:42.608 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 服务器版本号: 8.5.69.0
26-Jul-2021 14:51:42.608 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 操作系统名称: Windows 10
26-Jul-2021 14:51:42.608 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS.版本: 10.0
26-Jul-2021 14:51:42.608 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 架构: amd64
26-Jul-2021 14:51:42.609 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java 环境变量: D:\jdk\jre
26-Jul-2021 14:51:42.609 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java虚拟机版本: 1.8.0_74-b02
26-Jul-2021 14:51:42.609 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM.供应商: Oracle Corporation
26-Jul-2021 14:51:42.610 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Users\fanjj29\.SmartTomcat\servletdemo03\servletdemo03
26-Jul-2021 14:51:42.610 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: C:\Users\fanjj29\.SmartTomcat\servletdemo03\servletdemo03
26-Jul-2021 14:51:42.610 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Djava.util.logging.config.file=C:\Users\fanjj29\.SmartTomcat\servletdemo03\servletdemo03\conf\logging.properties
26-Jul-2021 14:51:42.610 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
26-Jul-2021 14:51:42.611 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dfile.encoding=UTF-8
26-Jul-2021 14:51:42.611 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent 使用APR版本[1.7.0]加载了基于APR的Apache Tomcat本机库[1.2.30]。
26-Jul-2021 14:51:42.612 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR功能:IPv6[true]、sendfile[true]、accept filters[false]、random[true]。
26-Jul-2021 14:51:42.614 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL配置:useAprConnector[false],useOpenSSL[true]
26-Jul-2021 14:51:42.623 信息 [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL成功初始化 [OpenSSL 1.1.1k 25 Mar 2021]
26-Jul-2021 14:51:42.749 信息 [main] org.apache.coyote.AbstractProtocol.init 初始化协议处理器 ["http-nio-8080"]
26-Jul-2021 14:51:42.866 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
26-Jul-2021 14:51:42.877 信息 [main] org.apache.catalina.startup.Catalina.load Initialization processed in 936 ms
26-Jul-2021 14:51:42.930 信息 [main] org.apache.catalina.core.StandardService.startInternal 正在启动服务[Catalina]
26-Jul-2021 14:51:42.930 信息 [main] org.apache.catalina.core.StandardEngine.startInternal 正在启动 Servlet 引擎:[Apache Tomcat/8.5.69]
26-Jul-2021 14:51:43.946 信息 [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars 至少有一个JAR被扫描用于TLD但尚未包含TLD。 为此记录器启用调试日志记录,以获取已扫描但未在其中找到TLD的完整JAR列表。 在扫描期间跳过不需要的JAR可以缩短启动时间和JSP编译时间。
26-Jul-2021 14:51:44.128 警告 [localhost-startStop-1] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom 使用[SHA1PRNG]创建会话ID生成的SecureRandom实例花费了[143]毫秒。
26-Jul-2021 14:51:44.157 信息 [main] org.apache.coyote.AbstractProtocol.start 开始协议处理句柄["http-nio-8080"]
26-Jul-2021 14:51:44.167 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in 1290 ms
web.xml的内容
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<web-app>
<servlet>
<servlet-name>CheckBox</servlet-name>
<servlet-class>com.servlet.demo01.CheckBox</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>CheckBox</servlet-name>
<url-pattern>/checkbox</url-pattern>
</servlet-mapping>
</web-app>
CheckBox的代码
package com.servlet.demo01;
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 fanjj29
*/
@WebServlet("/CheckBox")
public class CheckBox extends HttpServlet {
private static final long serialVersionUID = 1L;
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, IOException {
// 设置响应内容类型
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
String title = "读取复选框数据";
String docType = "<!DOCTYPE html> \n";
out.println(docType +
"<html>\n" +
"<head><title>" + title + "</title></head>\n" +
"<body bgcolor=\"#f0f0f0\">\n" +
"<h1 align=\"center\">" + title + "</h1>\n" +
"<ul>\n" +
" <li><b>教程标识:</b>: "
+ request.getParameter("runoob") + "\n" +
" <li><b>Google 标识:</b>: "
+ request.getParameter("google") + "\n" +
" <li><b>淘宝标识:</b>: "
+ request.getParameter("taobao") + "\n" +
"</ul>\n" +
"</body></html>");
}
// 处理 POST 方法请求的方法
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
}
html代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>复选框</title>
</head>
<body>
<form action="CheckBox" method="POST" target="_blank">
<input type="checkbox" name="runoob" checked="checked"/>教程
<input type="checkbox" name="google"/>Google
<input type="checkbox" name="taobao" checked="checked"/>淘宝
<input type="submit" value="选择站点"/>
</form>
</body>
</html>
只能执行.java的内容
htmld的端口也不是8080