当前位置: 首页 > wzjs >正文

怎么分析网站的外链建设情况百度竞价运营

怎么分析网站的外链建设情况,百度竞价运营,什么是黄页,table网站模版文章目录 1.模块创建1.创建一个webapp的maven项目2.目录结构 2.代码1.HomeController.java2.home.jsp3.applicationContext.xml Spring配置文件4.spring-mvc.xml SpringMVC配置文件5.web.xml 配置中央控制器以及Spring和SpringMVC配置文件的路径6.index.jsp 3.配置Tomcat1.配置…

文章目录

    • 1.模块创建
        • 1.创建一个webapp的maven项目
        • 2.目录结构
    • 2.代码
        • 1.HomeController.java
        • 2.home.jsp
        • 3.applicationContext.xml Spring配置文件
        • 4.spring-mvc.xml SpringMVC配置文件
        • 5.web.xml 配置中央控制器以及Spring和SpringMVC配置文件的路径
        • 6.index.jsp
    • 3.配置Tomcat
        • 1.配置路径以及热加载
        • 2.配置war包以及上下文路径为/
        • 3.启动
          • 1.首页
          • 2.访问 /home
    • 4.初始化基本流程解析

1.模块创建

1.创建一个webapp的maven项目

CleanShot 2025-02-10 at 12.21.01@2x

2.目录结构

CleanShot 2025-02-10 at 12.39.37@2x

2.代码

1.HomeController.java
package com.example.controller;import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;/*** Description:** @Author sun* @Create 2025/2/10 12:23* @Version 1.0*/
@Controller
public class HomeController {@RequestMapping("/home")public String home(Model model) {System.out.println("SpringMVC 执行了 home() 方法");model.addAttribute("message", "Hello, SpringMVC!");return "home"; // 返回 home.jsp}
}
2.home.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head><meta charset="UTF-8"><title>SpringMVC Demo</title>
</head>
<body>
<h2>${message}</h2>
</body>
</html>
3.applicationContext.xml Spring配置文件
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:context="http://www.springframework.org/schema/context"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"><!-- 扫描 Service 组件 --><context:component-scan base-package="com.example.service"/></beans>
4.spring-mvc.xml SpringMVC配置文件
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:context="http://www.springframework.org/schema/context"xmlns:mvc="http://www.springframework.org/schema/mvc"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsdhttp://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd"><!-- 启用Spring MVC注解 --><mvc:annotation-driven/><!-- 扫描 Controller 层 --><context:component-scan base-package="com.example.controller"/><!-- 视图解析器 --><bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"><property name="prefix" value="/WEB-INF/views/"/><property name="suffix" value=".jsp"/></bean></beans>
5.web.xml 配置中央控制器以及Spring和SpringMVC配置文件的路径
<?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_4_0.xsd"version="4.0"><!-- 配置Spring MVC的DispatcherServlet --><servlet><servlet-name>dispatcher</servlet-name><servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class><init-param><param-name>contextConfigLocation</param-name><param-value>/WEB-INF/spring-mvc.xml</param-value></init-param><load-on-startup>1</load-on-startup></servlet><servlet-mapping><servlet-name>dispatcher</servlet-name><url-pattern>/</url-pattern></servlet-mapping><!-- 配置Spring的ContextLoaderListener(用于加载根上下文) --><listener><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener><context-param><param-name>contextConfigLocation</param-name><param-value>/WEB-INF/applicationContext.xml</param-value></context-param>
</web-app>
6.index.jsp
<html>
<body>
<h2>Hello World!</h2>
</body>
</html>

3.配置Tomcat

1.配置路径以及热加载

CleanShot 2025-02-10 at 12.43.14@2x

2.配置war包以及上下文路径为/

CleanShot 2025-02-10 at 12.43.41@2x

3.启动
1.首页

CleanShot 2025-02-10 at 12.44.26@2x

2.访问 /home

CleanShot 2025-02-10 at 12.44.53@2x

CleanShot 2025-02-10 at 12.44.40@2x

4.初始化基本流程解析

  1. Tomcat启动,读取web.xml,装载中央控制器以及获取Spring以及SpringMVC的配置文件路径
  2. 由于中央控制器配置了load-on-startup所以会调用中央控制器的init方法完成Spring以及SpringMVC容器的初始化
http://www.dtcms.com/wzjs/502945.html

相关文章:

  • 网站制作公司怎样帮客户做优化东莞seo软件
  • 正规网站建设多少钱百度做广告怎么收费
  • 微信 网站模板logo网站设计
  • 集团做网站优势推广app网站
  • 电商网页美工设计国内专业seo公司
  • 电商网站系统建设国际新闻快报
  • 合肥 网站建设公司海南百度推广开户
  • 免费推广做产品的网站优化落实防控措施
  • 网站制作公司智能 乐云践新网站怎么做到秒收录
  • 世界上有php应用的网站网络运营是什么意思
  • 绵阳集团网站建设企业网站的优化建议
  • 成都网站建设学校软文广告经典案例
  • 南宁手机做网站公司网络广告策划与制作
  • 网页设计基础读书笔记自动app优化官网
  • 网站站点建设南宁百度快速优化
  • 响应式网站建设怎么做推广让别人主动加我
  • 小榄网站跨境电商平台排行榜前十名
  • 四川省成华区建设局网站搜索推广
  • 小企业公司网站建设购买友情链接
  • 石家庄制作网站软件chatgpt 链接
  • 王占山 同济大学绍兴百度推广优化排名
  • 建设公司网站步骤网站推广的意义和方法
  • 能够做物理题的网站百度seo优化是做什么的
  • 沈阳房地产网站开发网站建设怎么弄
  • 电子商务网站建设课程的心得国外搜索引擎大全百鸣
  • 企业网站内容的制作36优化大师下载安装
  • 自己做qq头像网站代引流推广公司
  • 常见的建站工具谷歌浏览器下载手机版
  • php网站开发教材短视频推广app
  • 网站做淘宝客石家庄新闻网