求助大家,我在测试springmvc案例的时候,重新装Tomcat服务器,没有运行的图标,是因为什么原因呢

博主在尝试测试SpringMVC应用时遇到问题,重新安装了Tomcat 8.5版本后发现没有运行图标。已确认完成web.xml配置和环境变量、pom.xml的设置,寻求解决方案。
摘要由CSDN通过智能技术生成

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @outhor yuyu
 * @date 2022/4/24   18:45
 **/
@Controller
public class HellowController {
    @RequestMapping("/")
    public String index(){
        //返回视图名称
        return  "index";
    }
}

已经在Tomcat中下载了8.5版本

web.xml也已经配置

<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the Lice
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Tomcat是一个开源的Java Web服务器,用于运行Java应用程序。当Tomcat加载SpringSpring MVC时,它遵循以下过程: 1. Tomcat从web.xml文件中加载DispatcherServlet,这是Spring MVC框架的核心组件。 2. DispatcherServlet的初始化方法被调用,它负责初始化Spring MVC的配置并与Spring框架进行集成。 3. 在初始化过程中,DispatcherServlet会读取Spring的配置文件,通常是applicationContext.xml。这个配置文件包含了定义Spring Bean的信息,以及其他的配置。 4. Spring框架会根据配置文件中的信息,创建和管理Bean对象,这些Bean对象是应用程序中的各个组件,比如控制器、服务层、数据访问层等。 5. 当有HTTP请求到达Tomcat服务器时,DispatcherServlet会拦截请求并将其传递给适当的控制器。 6. 控制器会执行业务逻辑,并根据请求的内容生成相应的模型数据。 7. DispatcherServlet将模型数据传递给视图解析器,并选择适当的视图来展示数据。 8. 最后,DispatcherServlet将视图渲染为HTML响应,返回给客户端。 总结来说,Tomcat加载SpringSpring MVC是通过初始化DispatcherServlet,并根据配置文件创建和管理Spring Bean来实现的。这个过程可以使开发者更方便地使用SpringSpring MVC框架来开发Java Web应用程序。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [从设计模式+源码讲到Tomcat加载Spring,你还不懂?](https://blog.csdn.net/weixin_42864905/article/details/110921634)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *3* [springmvc+maven+tomcat服务器+demo](https://download.csdn.net/download/qypt2015/11832828)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值