Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
378 views
in Technique[技术] by (71.8m points)

新建web项目创建servlet之后,访问不到这个servlet ,

启动项目没有报错,访问这个servlet之后提醒java.lang.ClassNotFoundException:
但是实际上,项目里面有这个servlet文件
image.png
image.png
web.xml里面配置的class路径也应该没有问题
image.png

jdk 是1.8的,tomcat是8.5的这个平时公司的项目也是这个,应该没问题呀,不知道为什么我自己建个项目就会找不到呢


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

eclipse默认class文件编译到build文件夹里面,要改一下
刚刚在segmentfault里面发现我在两年之前就问过这个问题
我得反思下这两年我在干嘛了


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...