Petclinic Spring示例返回“无法加载资源”

时间:2012-09-10 18:02:48

标签: spring

我刚刚从此网站下载了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

1 个答案:

答案 0 :(得分:2)

Petclinic样本有点过时,在Tomcat上有一个已知问题,请参阅SPR-7893

如果您想让它在Tomcat上运行,您需要创建一个名为src/main/webapp/static的文件夹,并在那里移动htmlimagesstyles个文件夹。