idea创建普通Web项目lib目录无法输出,tomcat不报错问题
idea创建普通Web项目lib目录无法输出,tomcat不报错问题
idea版本:2021.2
tomcat版本:9.0.50
项目结构
创建一个普普通通的web项目,目录结构大概就是这样
.
├── .idea
│ ├── artifacts
│ ├── inspectionProfiles
│ ├── libraries
│ └── sonarlint
│ └── issuestore
├── conf
├── lib
├── out
│ ├── artifacts
│ │ └── test03_war_exploded
│ │ └── WEB-INF
│ │ ├── classes
│ │ │ └── top
│ │ │ └── ctong
│ │ │ └── controller
│ │ └── lib
│ └── production
│ └── test03
│ ├── generated
│ └── top
│ └── ctong
│ └── controller
├── src
│ └── top
│ └── ctong
│ └── controller
└── web
└── WEB-INF
lib文件夹已经设置为Library文件夹。
controller搞了个hello请求
@Controller
public class TestController implements Serializable {
private static final long serialVersionUID = 6290967590153117614L;
@RequestMapping("/hello")
public void test01() {
System.out.println("Hello World!");
}
}
配置了自动包扫描
<?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:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<context:component-scan base-package="top.ctong"/>
</beans>
加载了DispatcherServlet
<?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">
<servlet>
<servlet-name>dispatcherServlet</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>
</servlet>
<servlet-mapping>
<servlet-name>dispatcherServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
问题
点启动,访问/hello成功荣获404….干掉out目录重启….404…
重新建一个项目,启动…..hello world…..
再创建新项目,启动…404…
打开FileMerge文件对比工具…嗯?差不多啊…
…打开out文件夹,嗯?怎么lib目录没加进来…
…反反复复2天后…
…
…
…
解决
尝试将lib目录拖进web/WEB-INF目录…hello world…
不信邪,再把lib拖到项目根目录…404…
……MMP……我之前一直这样都没问题…
不知道第几次打开 idea === >> Proiect Structure…
无意间点了 Proiect Settings ===>> Artifacts…嗯?怎么有警告…..

Library lib ' required for module test03 is missing from the artifact 嗯?莫名其妙双击了右边的lib。警告消失了…
启动…hello world…
什么妖魔鬼怪…
idea创建普通Web项目lib目录无法输出,tomcat不报错问题的更多相关文章
- 刚创建的maven项目,pom.xml的第一行就报错
刚创建的maven项目,马上pom.xml的第一行就报错这是第一行:<project xmlns="http://maven.apache.org/POM/4.0.0" xm ...
- STS创建spring boot项目,pom.xml文件第一行报错
亲测能用url地址:https://blog.csdn.net/jrx1995/article/details/100008552
- 创建maven web项目无法创建sec目录
创建maven web项目无法创建sec目录 解决方法:-DarchetypeCatalog=internal
- springmvc 项目完整示例02 项目创建-eclipse创建动态web项目 配置文件 junit单元测试
包结构 所需要的jar包直接拷贝到lib目录下 然后选定 build path 之后开始写项目代码 配置文件 ApplicationContext.xml <?xml version=" ...
- Intellij Idea 创建一个Web项目
今天想用IDEA创建一个web项目: 准备工具 1.jdk1.7 2.tomcat6.0,由于下载的8.5没有lib目录不能配置改6.0 3.idea2019.1.2 Intellij Idea的安装 ...
- 创建简单web项目
Intellij Idea直接安装(可根据需要选择自己设置的安装目录),jdk使用1.6/1.7/1.8都可以,主要是配置好系统环境变量,tomcat7上tomcat的官网下载压缩包解压即可. 一.创 ...
- IDEA创建动态Web项目
1.IDEA创建动态Web项目 1.1.使用IDEA创建动态Web项目,选择Java Enterprise,记得选择服务器,我这里使用的时tomcat 1.2记得勾选Web Application,其 ...
- eclipse创建maven web项目
eclipse创建maven web项目: 1.安装eclipse maven插件 2.新建maven project选择webapp模板. 3.改造为maven文档结构. 4.添加项目的JAVAEE ...
- eclipes创建一个web项目web.xml不能自动更新的原因(web.xml和@WebServlet的作用)
在eclipse中创建一个Web项目的时候,虽然有web.xml生成,但是再添加Servlet类文件的时候总是看不见web.xml的更新,所以异常的郁闷!上网查了查,原来我们在创建Web项目的时候,会 ...
随机推荐
- 精尽Spring Boot源码分析 - Jar 包的启动实现
该系列文章是笔者在学习 Spring Boot 过程中总结下来的,里面涉及到相关源码,可能对读者不太友好,请结合我的源码注释 Spring Boot 源码分析 GitHub 地址 进行阅读 Sprin ...
- 03 Git 以及 其 GUI TortoiseGit 的下载与安装
前面也说过嘛,要紧跟大佬们的步伐--选择最受欢迎的版本控制系统. 而根据 [JetBrains](JetBrains: Essential tools for software developers ...
- AWS上创建EKS(K8S)集群
1.注意事项及准备工作 EKS分为EKS Master和EKS Node两种角色;EKS Master为全托管,EKS Node为CloudFormation创建 EKS Node若在NAT网络里,一 ...
- 2020年12月-第01阶段-前端基础-HTML CSS 项目阶段(四)
1. 品优购项目(四) 1). 详情页 detail.html 常用单词 名称 说明 主体 de_container 面包屑导航 crumb_wrap 产品介绍 product_intro ( int ...
- css input 设置只读样式
input[readonly]{ background-color: #EEEEEE !important; }
- iOS 针对txt文档进行解码
如我上一篇文章记录,我加了打开其他APPtxt文件的小功能,紧接着碰到新问题了,我在测试过程中发现用户上传的TXT编码格式很多不单单是utf-8和gb2312,针对TXT文档进行解码,我一共经历过两个 ...
- [源码解析] 深度学习分布式训练框架 horovod (13) --- 弹性训练之 Driver
[源码解析] 深度学习分布式训练框架 horovod (13) --- 弹性训练之 Driver 目录 [源码解析] 深度学习分布式训练框架 horovod (13) --- 弹性训练之 Driver ...
- linux修改 ls 命令的时间显示格式
一直不习惯 ll 命令将时间日期格式显示为 周名和月名,想要纯粹的 数字格式,找了好久,终于想到一个办法--alias. [root@localhost ~]# alias #显示当前已存在的alia ...
- Docker:Linux离线安装docker
docker离线下载路径 docker所有版本:https://download.docker.com/linux/static/stable/ 离线安装 1.解压 #解压tar包 tar -xvf ...
- SpringBoot中如何监听两个不同源的RabbitMQ消息队列
spring-boot如何配置监听两个不同的RabbitMQ 由于前段时间在公司开发过程中碰到了一个问题,需要同时监听两个不同的rabbitMq,但是之前没有同时监听两个RabbitMq的情况,因此在 ...