【问题标题】:Petclinic Spring example returns "Failed to load resource"Petclinic Spring 示例返回“加载资源失败”
【发布时间】:2012-09-10 18:02:48
【问题描述】:

我刚刚从这个网站下载了宠物诊所应用程序: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

【问题讨论】:

    标签: spring


    【解决方案1】:

    Petclinic 示例有点过时,并且在 Tomcat 上有一个已知问题,请参阅 SPR-7893

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

    【讨论】:

    • 我创建了文件夹 src/main/webapp/static 并将 html、images 和 styles 文件夹移动到它,图像和样式仍然损坏。
    猜你喜欢
    • 2016-04-24
    • 1970-01-01
    • 2022-09-30
    • 2013-03-18
    • 1970-01-01
    • 2012-07-24
    • 2018-01-15
    • 2013-02-26
    • 2019-05-28
    相关资源
    最近更新 更多