会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 132450个问题
大数据全系列/第一阶段:Linux 操作系统/Linux操作系统概述与安装 19996楼
JAVA 全系列/第一阶段:JAVA 快速入门/JAVA入门和背景知识 19997楼

老师,我根据老师的配置复制到IDE 里面显示报错。是 我少了什么文件吗

classpath:applicationContext-*.xml

springmvc.xml
 
 <?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配置文件路径 -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:applicationContext-*.xml</param-value>
    </context-param>
    <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>
    </servlet>
    <servlet-mapping>
        <servlet-name>springmvc</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <filter>
        <filter-name>encoding</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>utf-8</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>encoding</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <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>
</web-app>

image.png

JAVA 全系列/第六阶段:项目管理与SSM框架/RBAC实战 20001楼

<div class="head">
    <div class="head-in">
        <ul class="options">
            <li class="sub"><a href="http://127.0.0.1:8000/?category=2#">我的订单</a></li>

            <li class="sub"><a href="/">商城首页</a></li>
            <li class="sub"><a href="/cart/queryAll/">我的购物车</a></li>
        </ul>

        {% if loginUser %}
            <div class="register">欢迎 <a href="/user/center/" style="color: red;">{{ loginUser.uname }}</a></div>

        {% else %}
            <div class="register"><a href="/user/register/">免费注册</a></div>
            <div class="sign"><a href="/user/login/">登录</a></div>

        {% endif %}



    </div>
</div>
<div class="search">
    <ul class="items">
        <li class="item">
            <a href="http://127.0.0.1:8000/?category=2#">
                <img src="/static/1_09.png">
                <p>10:00开抢</p>
            </a>
        </li>
        <li class="item">
            <a href="http://127.0.0.1:8000/?category=2#">
                <img src="/static/1_11.png">
                <p>买手砍价</p>
            </a>
        </li>
        <li class="item">
            <a href="http://127.0.0.1:8000/?category=2#">
                <img src="/static/1_13.png">
                <p>验货质检</p>
            </a>
        </li>
    </ul>
    <div class="input">
        <input type="" name="" value="请输入想找的宝贝">
        <img src="/static/1_06.png">
    </div>
</div>

老师,我们这个项目中很多html文件用到静态文件,比如这个top.html,但是都没有通过{% load static %}引入,这样也可以么?

Python 全系列/下架-第十二阶段:Python_大型电商项目(5天后下架)/Django项目阶段-电商项目(旧) 20003楼
JAVA 全系列/第一阶段:JAVA 快速入门/IDEA的使用和第一个java项目 20004楼
JAVA 全系列/第一阶段:JAVA 快速入门/IDEA的使用和第一个java项目 20005楼
JAVA 全系列/第六阶段:项目管理与SSM框架/SpringMVC 20007楼
Python 全系列/第一阶段:Python入门/控制语句 20009楼
JAVA 全系列/第九阶段:权限控制与安全认证/Spring Security(旧) 20010楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园
网站维护:百战汇智(北京)科技有限公司
京公网安备 11011402011233号    京ICP备18060230号-3    营业执照    经营许可证:京B2-20212637