springMVC下创建的webapp没有小蓝点

问题描述:

springMVC下创建的webapp没有小蓝点,那么我们就无法在该目录下创建jsp等类型的文件,这个时候就需要我们把这个小蓝点加上去。

在这里插入图片描述

解决方案:

需要打开项目结构

在这里插入图片描述

打开Project Structure,找到我们创建的Module,在该模块目录下找到Web框架,如果没有可以重启idea。修改路径,在路径的WEB-INF前加上src\main\webapp即可。

在这里插入图片描述
这样小蓝点就会出现了!
在这里插入图片描述

  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
SpringMVC的配置文件主要是通过XML文件来进行配置的。下面是创建SpringMVC的XML配置文件的步骤: 1. 创建一个名为"spring-servlet.xml"的文件,命名规则可以自定义,但是一般情况下按照这个规则命名比较好。 2. 在该XML文件添加根元素<beans>。 3. 在<beans>元素添加<bean>元素,该元素用于定义SpringMVC的各种组件,如控制器、视图解析器、拦截器等。 4. 在<bean>元素添加各种属性,如id、class、scope等。 5. 在<bean>元素添加各种子元素,如<property>、<constructor-arg>等,用于设置该组件的属性值。 6. 在<beans>元素添加<import>元素,用于引入其他的XML配置文件。 例如,下面是一个简单的SpringMVC的XML配置文件: ```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-4.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd"> <!-- 控制器配置 --> <bean id="helloController" class="com.example.controller.HelloController"/> <!-- 视图解析器配置 --> <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/WEB-INF/views/"/> <property name="suffix" value=".jsp"/> </bean> <!-- 静态资源访问配置 --> <mvc:resources mapping="/static/**" location="/static/"/> <!-- 拦截器配置 --> <mvc:interceptors> <bean id="loginInterceptor" class="com.example.interceptor.LoginInterceptor"/> </mvc:interceptors> <!-- 包扫描配置 --> <context:component-scan base-package="com.example"/> </beans> ``` 该配置文件定义了一个HelloController控制器、一个InternalResourceViewResolver视图解析器、一个静态资源访问配置以及一个LoginInterceptor拦截器。同时,还配置了包扫描的基础包为com.example。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值