@artshelom

При запуске проекта не показывает картинки и шрифт не добавляется, как исправить??

Код в .css
@font-face {
    font-family: 'BebasNeueBold';
    src: url(''/WEB-INF/css/font/BebasNeue/BebasNeueBold.eot');
    src: local('☺'), url('/WEB-INF/css/font/BebasNeue/BebasNeueBold.woff') format('woff'),
    url(''/WEB-INF/css/font/BebasNeue/BebasNeueBold.ttf') format('truetype'),
    url(''/WEB-INF/css/font/BebasNeue/BebasNeueBold.svg') format('svg');
    font-weight: normal;
    font-style: normal;
}

А картинки вот с таким кодом у меня в jsp:
logo.png

При запуске проекта не показывает картинки пишет ошибки, что не нашли файл ошибки в хроме:
Failed to load resource: the server responded with a status of 404 ()

Как это можно исправить?
в интернете рабочего решения для себя не нашел((
  • Вопрос задан
  • 65 просмотров
Решения вопроса 1
sergey-gornostaev
@sergey-gornostaev Куратор тега Java
Седой и строгий
В Java™ Servlet Specification version 3.1 написано:
A special directory exists within the application hierarchy named WEB-INF. This directory contains all things related to the application that aren’t in the document root of the application. The WEB-INF node is not part of the public document tree of the application. No file contained in the WEB-INF directory may be served directly to a client by the container. However, the contents of the WEB-INF directory are visible to servlet code using the getResource and getResourceAsStream method calls on the ServletContext, and may be exposed using the RequestDispatcher calls.

Проще говоря, не надо складывать в WEB-INF статику.
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы
Bell Integrator Ульяновск
До 400 000 ₽
Bell Integrator Хабаровск
До 400 000 ₽
Bell Integrator Ижевск
До 400 000 ₽
19 апр. 2024, в 05:01
999999 руб./за проект
19 апр. 2024, в 03:52
1000 руб./за проект
19 апр. 2024, в 03:01
1000 руб./за проект