最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

關(guān)于springmvc報(bào)錯(cuò)404的問題

 更新時(shí)間:2021年03月17日 15:49:56   作者:影落潮生0  
這篇文章主要介紹了關(guān)于springmvc報(bào)錯(cuò)404的問題,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下

最近初學(xué)springmvc,做了一個(gè)簡單工程實(shí)現(xiàn)Conntroller加載,一直報(bào)錯(cuò)404,調(diào)試許久沒找到問題,請求幫助,多謝各位了!

編程環(huán)境:win10x64+eclipse+Tomcat8.5
文件結(jié)構(gòu):

主要代碼:
web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>MyWeb</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>

<!-- 加載spring配置文件 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:springMvc.xml</param-value>
</context-param>
<!-- spring監(jiān)聽 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- 配置springMvc -->
<servlet>
<servlet-name>springMvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:springMvc.xml</param-value>
</init-param>

<load-on-startup>1</load-on-startup>
<async-supported>true</async-supported>
</servlet>

<servlet-mapping>
<servlet-name>springMvc</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>

</web-app>

HelloController.java

package com.hello;

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

@Controller
public class HelloController {

@RequestMapping("/success")
public String helloWorld() {
System.out.println("攔截");
return "success";
}
}

springMvc.xml

<?xml version="1.0" encoding="UTF-8"?>

<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.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd ">

<mvc:annotation-driven />

<context:component-scan base-package="com.hello"/>

<!-- 處理靜態(tài)資源 -->
<mvc:default-servlet-handler/>

<!-- 配置視圖解析器 -->
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
</bean>
</beans>

調(diào)試圖:

到此這篇關(guān)于關(guān)于springmvc報(bào)錯(cuò)404的問題的文章就介紹到這了,更多相關(guān)springmvc報(bào)錯(cuò)404內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • IDEA實(shí)現(xiàn)添加 前進(jìn)后退 到工具欄的操作

    IDEA實(shí)現(xiàn)添加 前進(jìn)后退 到工具欄的操作

    這篇文章主要介紹了IDEA 前進(jìn) 后退 添加到工具欄的操作,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2021-02-02
  • Java對象池pool2分析PooledObjectFactory過程

    Java對象池pool2分析PooledObjectFactory過程

    文章介紹了Java中對象池化技術(shù)的背景,以Apache的Pool2庫為例,詳細(xì)講解了GenericObjectPool的構(gòu)造函數(shù)參數(shù)和PooledObjectFactory接口的實(shí)現(xiàn),通過商場里的共享充電寶的比喻,說明了池化思維的應(yīng)用
    2025-02-02
  • Java并發(fā)包工具類CountDownLatch的應(yīng)用詳解

    Java并發(fā)包工具類CountDownLatch的應(yīng)用詳解

    CountDownLatch是Java并發(fā)包中非常實(shí)用的一個(gè)工具類,它可以幫助我們實(shí)現(xiàn)線程之間的同步和協(xié)作。本文主要介紹了CountDownLatch的應(yīng)用場景及最佳實(shí)踐,希望對大家有所幫助
    2023-04-04
  • Kotlin?標(biāo)準(zhǔn)函數(shù)和靜態(tài)方法示例詳解

    Kotlin?標(biāo)準(zhǔn)函數(shù)和靜態(tài)方法示例詳解

    這篇文章主要為大家介紹了Kotlin?標(biāo)準(zhǔn)函數(shù)和靜態(tài)方法示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-10-10
  • redisson 實(shí)現(xiàn)分布式鎖的源碼解析

    redisson 實(shí)現(xiàn)分布式鎖的源碼解析

    這篇文章主要介紹了redisson 實(shí)現(xiàn)分布式鎖的源碼解析,通過模擬一個(gè)商品秒殺的場景結(jié)合示例代碼給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2022-05-05
  • Spring Cloud Ribbon負(fù)載均衡器處理方法

    Spring Cloud Ribbon負(fù)載均衡器處理方法

    這篇文章主要介紹了Spring Cloud Ribbon負(fù)載均衡器處理方法,看看是如何獲取服務(wù)實(shí)例,獲取以后做了哪些處理,處理后又是如何選取服務(wù)實(shí)例的,需要的朋友可以參考下
    2018-02-02
  • ElasticSearch不停機(jī)重建索引延伸思考及優(yōu)化詳解

    ElasticSearch不停機(jī)重建索引延伸思考及優(yōu)化詳解

    這篇文章主要為大家介紹了ElasticSearch不停機(jī)重建索引延伸思考及優(yōu)化詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-02-02
  • 詳解Spring?Bean的配置方式與實(shí)例化

    詳解Spring?Bean的配置方式與實(shí)例化

    本文主要帶大家一起學(xué)習(xí)一下Spring?Bean的配置方式與實(shí)例化,文中的示例代碼講解詳細(xì),對我們學(xué)習(xí)Spring有一定的幫助,需要的可以參考一下
    2022-06-06
  • java基于jdbc連接mysql數(shù)據(jù)庫功能實(shí)例詳解

    java基于jdbc連接mysql數(shù)據(jù)庫功能實(shí)例詳解

    這篇文章主要介紹了java基于jdbc連接mysql數(shù)據(jù)庫功能,結(jié)合實(shí)例形式詳細(xì)分析了jdbc連接mysql數(shù)據(jù)庫的原理、步驟、實(shí)現(xiàn)方法及相關(guān)操作技巧,需要的朋友可以參考下
    2017-10-10
  • Mybatis-Plus讀寫Mysql的Json字段的操作代碼

    Mybatis-Plus讀寫Mysql的Json字段的操作代碼

    這篇文章主要介紹了Mybatis-Plus讀寫Mysql的Json字段的操作代碼,文中通過實(shí)例代碼給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2022-04-04

最新評論

竹山县| 湄潭县| 吐鲁番市| 长治县| 郧西县| 安吉县| 沭阳县| 湘阴县| 全南县| 文水县| 丹巴县| 铁岭县| 沿河| 渝北区| 惠东县| 黎城县| 仪陇县| 高青县| 象山县| 巧家县| 辽宁省| 文昌市| 太仆寺旗| 余庆县| 松原市| 南川市| 台湾省| 汝阳县| 新平| 那曲县| 武清区| 奉新县| 简阳市| 西和县| 闵行区| 枣庄市| 赤壁市| 哈巴河县| 徐闻县| 新龙县| 广河县|