网页打不开

网页打不开

打包也打好了 startup也启动了 server也改了

https://img1.sycdn.imooc.com//climg/62808ba708fb94ee11320893.jpg

https://img1.sycdn.imooc.com//climg/62808bf8081d63d104590279.jpg

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.imooc</groupId>
    <artifactId>web-servlet</artifactId>
    <version>1.0.0-RELEASE</version>

    <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
    </properties>
<packaging>war</packaging>

    <dependencies>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <build>
        <finalName>web-servlet</finalName>

    </build>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
         version="3.1">
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>default.html</welcome-file>
    </welcome-file-list>
    <servlet>
        <servlet-name>request</servlet-name>
        <servlet-class>com.imooc.servlet.RequestServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>request</servlet-name>
        <url-pattern>/request</url-pattern>
    </servlet-mapping>
    <servlet>
        <servlet-name>pattern</servlet-name>
        <servlet-class>com.imooc.servlet.PatternServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>pattern</servlet-name>
        <url-pattern>/class/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>pattern</servlet-name>
        <url-pattern>*.class</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>pattern</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>
    <servlet>
        <servlet-name>initTable</servlet-name>
        <servlet-class>com.imooc.servlet.startup.InitTableServlet</servlet-class>
        <init-param>
            <param-name>database</param-name>
            <param-value>db01</param-value>
        </init-param>
        <load-on-startup>0</load-on-startup>
    </servlet>
    <servlet>
        <servlet-name>import</servlet-name>
        <servlet-class>com.imooc.servlet.startup.ImportServlet</servlet-class>
        <init-param>
            <param-name>file</param-name>
            <param-value>c:/tmp/demo.txt</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <error-page>
        <error-code>404</error-code>
        <location>/error/404.html</location>
    </error-page>
    <error-page>
        <error-code>500</error-code>
        <location>/error/500.html</location>
    </error-page>
</web-app>


正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
好帮手慕小小 2022-05-15 16:56:34

同学你好,可能是同学tomcat未成功启动,也可能是端口号不正确。建议确认下tomcat是否成功启动及端口号是否正确。

祝学习愉快~

问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师