我刚刚从此网站下载了petclinic应用程序:https://src.springframework.org/svn/spring-samples/。
我在Eclipse中导入它,服务器是Tomcat 7,应用程序正在运行,但静态数据,如图像和脚本不是:
Failed to load resource: the server responded with a status of 404 (Not Found) petclinic/static/styles/petclinic.css
Failed to load resource: the server responded with a status of 404 (Not Found) /petclinic/static/images/pets.png
Failed to load resource: the server responded with a status of 404 (Not Found) /petclinic/static/images/springsource-logo.png
答案 0 :(得分:2)
Petclinic样本有点过时,在Tomcat上有一个已知问题,请参阅SPR-7893。
如果您想让它在Tomcat上运行,您需要创建一个名为src/main/webapp/static
的文件夹,并在那里移动html
,images
和styles
个文件夹。