新环境下重新导入Web项目遇到的一些问题

在 Win 10 环境下,进行了一次“全新启动”操作,重新安装了系统,过程中删除了部分安装的软件,但是工作目录等文件夹已然存在。重装了tomcat 和 eclipse,将原来的工作目录作为新工作目录。

1. tomcat 启动时信息乱码问题

conf/logging.properties 中的java.util.logging.ConsoleHandler.encoding由原来的UTF-8改为GBK,即

java.util.logging.ConsoleHandler.encoding = GBK

2.There is no resources that can be added or removed from the server

web项目右键菜单—— properties —— project facets, 在右边的选项栏中勾选三项,如图中所示。
在这里插入图片描述

3. JRE System Library[unbound]

在build path 中会提示找不到jre,选择 JRE System Library[unbound] —— 右侧选项栏中Edit —— 在弹出的窗口中Alternate JRE 处选择自己安装的jre即可。

另外,如果项目build path中没有tomcat 时,可在右侧选项栏中选择 add Library… —— Server Runtime —— 选择自己安装的tomcat 即可。

4. 404 之The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

上面步骤完成后,顺利启动web 项目,但在操作过程中报错 404, 描述为 The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.。经网上各种查资料,均未能如愿解决。

后来仔细检查项目的时候,才发现web.xml不见了,可能之前使用批处理删除东西的时候被删除了,于是补了回来(还好项目不大。。。)。

不会之后还是不行,在更仔细检查的时候,发现web.xml放错地方了,放在了WebContent 下而没有放在WEB-INF下。

将上述错误均修改过来后,web项目正常工作。

总结起来就是:补充web.xml并放到合适的文件夹中(WEB-INF下)

参考文献

https://blog.csdn.net/B2345012/article/details/88365722
https://www.cnblogs.com/rogear/p/7242586.html
https://blog.csdn.net/cnzyyh/article/details/51115377

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值