Форум программистов, компьютерный форум, киберфорум
Java: Spring, Spring Boot
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 5.00/3: Рейтинг темы: голосов - 3, средняя оценка - 5.00
0 / 0 / 1
Регистрация: 13.04.2013
Сообщений: 25

Spring mvs + jsp + fancybox

24.01.2017, 19:00. Показов 674. Ответов 6
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
Всем привет. Написал небольшую фото галерею на Spfing mvc. Фото выводит, но хотелось как то украсить. Нашел FancyBox, но подключить его ни в какую не получается. Просто открывается страница с фотографией.
Вот index.jsp
HTML5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!— language: lang-html —> 
 
 
<%@ page contentType="text/html; charset=UTF-8" language="java"%> 
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<%@ taglib uri="http://www.springframework.org/security/tags" 
prefix="sec"%> 
 
<!DOCTYPE html> 
<head> 
<title>Images</title> 
 
</head> 
<body> 
<h2>Images</h2> 
<c:forEach var="name" items="${imageNames}"> 
<img src="https://www.cyberforum.ru/images/image/?name=${name}"> 
</c:forEach> 
<br> 
<a class=".btn-link" href="javascript:history.back()">Назад</a> 
</body> 
</html>
Перепробовал кучу всего, не получилось.
0
cpp_developer
Эксперт
20123 / 5690 / 1417
Регистрация: 09.04.2010
Сообщений: 22,546
Блог
24.01.2017, 19:00
Ответы с готовыми решениями:

Spring+Jsp
Получаю набор ошибок Can not find the tag library descriptor for &quot;http://www.springframework.org/tags&quot; Для &lt;%@taglib...

Spring MVC, JSP
Здравствуйте. Есть следующая ситуация: есть jsp страница создания issue &lt;/head&gt; &lt;body&gt; &lt;nav class=&quot;navbar navbar-inverse...

Уроки Spring + jsp + БД (hibernate)
Добрый день, учу фреймворк Spring и JavaEE в целом. прочитал много уроков и видео посмотрел. В основном про Сервлеты и JSP. Да как...

6
Эксперт Java
3639 / 2971 / 918
Регистрация: 05.07.2013
Сообщений: 14,220
25.01.2017, 00:02
наверно скрипты-то стоит добавить на страницу?
1
0 / 0 / 1
Регистрация: 13.04.2013
Сообщений: 25
25.01.2017, 00:05  [ТС]
xoraxax, это понятно. Но они все равно не работаю. Пробовал, писал же
0
Эксперт Java
 Аватар для KEKCoGEN
2399 / 2224 / 565
Регистрация: 28.12.2010
Сообщений: 8,672
25.01.2017, 00:32
москвичанатолий, зачем тогда вы выложили сюда код в котором вообще ничего не подключено? Подключите скрипты, откройте консоль браузера, посмотрите какие ошибки там есть и если что-то неясно, напишите сюда ошибки и код которые их вызывает.
1
0 / 0 / 1
Регистрация: 13.04.2013
Сообщений: 25
25.01.2017, 00:40  [ТС]
KEKCoGEN,
собсно вот багрепорт:
HTML5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/jgallery/dist/js/jquery-2.0.3.min.js Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/jgallery/dist/css/font-awesome.min.css Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/jgallery/dist/js/jgallery.min.js?v=1.6.0 Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/fancybox/source/helpers/jquery.fancybox-buttons.css?v=1.0.5 Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/fancybox/source/jquery.fancybox.css?v=2.1.6 Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/packery/packery.css Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/packery/imagesloaded.pkgd.js Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/fancybox/source/helpers/jquery.fancybox-thumbs.css?v=1.0.7 Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/fancybox/lib/jquery.mousewheel-3.0.6.pack.js Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/fancybox/source/jquery.fancybox.pack.js?v=2.1.6 Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/fancybox/source/helpers/jquery.fancybox-buttons.js?v=1.0.5 Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/packery/packery.pkgd.min.js Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/fancybox/source/helpers/jquery.fancybox-media.js?v=1.0.6 Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/fancybox/source/helpers/jquery.fancybox-thumbs.js?v=1.0.7 Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/jgallery/dist/js/jgallery.min.js?v=1.6.0 Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/image/sbg/logo.png Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/packery/packery.css Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/packery/packery.pkgd.min.js Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/packery/imagesloaded.pkgd.js Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/fancybox/lib/jquery.mousewheel-3.0.6.pack.js Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/fancybox/source/jquery.fancybox.css?v=2.1.6 Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/fancybox/source/jquery.fancybox.pack.js?v=2.1.6 Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/fancybox/source/helpers/jquery.fancybox-buttons.css?v=1.0.5 Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/fancybox/source/helpers/jquery.fancybox-buttons.js?v=1.0.5 Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/fancybox/source/helpers/jquery.fancybox-media.js?v=1.0.6 Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/fancybox/source/helpers/jquery.fancybox-thumbs.css?v=1.0.7 Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/fancybox/source/helpers/jquery.fancybox-thumbs.js?v=1.0.7 Failed to load resource: the server responded with a status of 404 ()
VM93 images:145 Uncaught TypeError: $(...).fancybox is not a function
    at HTMLDocument.<anonymous> (VM93 images:145)
    at j (jquery-latest.min.js:2)
    at Object.fireWith [as resolveWith] (jquery-latest.min.js:2)
    at Function.ready (jquery-latest.min.js:2)
    at HTMLDocument.J (jquery-latest.min.js:2)
http://localhost:8090/secure/image/sbg/logo.png Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/jgallery/dist/css/font-awesome.min.css Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/jgallery/dist/css/jgallery.min.css?v=1.6.0 Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/packery/packery.css Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/fancybox/source/helpers/jquery.fancybox-buttons.css?v=1.0.5 Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/fancybox/source/jquery.fancybox.css?v=2.1.6 Failed to load resource: the server responded with a status of 404 ()
http://localhost:8090/secure/fancybox/source/helpers/jquery.fancybox-thumbs.css?v=1.0.7 Failed to load resource: the server responded with a status of 404 ()
Ну а вот немного переделанная страница:
HTML5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/security/tags"
    prefix="sec"%>
 
<!DOCTYPE html>
<head>
    <link href="<c:url value="/pages/css/bootstrap.css" />" rel="stylesheet">
 
    <link rel="stylesheet" type="text/css" media="all" href="jgallery/dist/css/font-awesome.min.css" />
    <link rel="stylesheet" type="text/css" media="all" href="jgallery/dist/css/jgallery.min.css?v=1.6.0" />
    <script type="text/javascript" src="jgallery/dist/js/jquery-2.0.3.min.js"></script>
    <script type="text/javascript" src="jgallery/dist/js/jgallery.min.js?v=1.6.0"></script>
    <link rel="stylesheet" href="packery/packery.css" />
    <script type="text/javascript" src="packery/packery.pkgd.min.js"></script>
    <script type="text/javascript" src="packery/imagesloaded.pkgd.js"></script>
    <!-- Add jQuery library -->
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
 
    <!-- Add mousewheel plugin (this is optional) -->
    <script type="text/javascript" src="fancybox/lib/jquery.mousewheel-3.0.6.pack.js"></script>
 
    <!-- Add fancyBox -->
    <link rel="stylesheet" href="fancybox/source/jquery.fancybox.css?v=2.1.6" type="text/css" media="screen" />
    <script type="text/javascript" src="fancybox/source/jquery.fancybox.pack.js?v=2.1.6"></script>
 
    <!-- Optionally add helpers - button, thumbnail and/or media -->
    <link rel="stylesheet" href="fancybox/source/helpers/jquery.fancybox-buttons.css?v=1.0.5" type="text/css" media="screen" />
    <script type="text/javascript" src="fancybox/source/helpers/jquery.fancybox-buttons.js?v=1.0.5"></script>
    <script type="text/javascript" src="fancybox/source/helpers/jquery.fancybox-media.js?v=1.0.6"></script>
 
    <link rel="stylesheet" href="fancybox/source/helpers/jquery.fancybox-thumbs.css?v=1.0.7" type="text/css" media="screen" />
    <script type="text/javascript" src="fancybox/source/helpers/jquery.fancybox-thumbs.js?v=1.0.7"></script>
    <style type="text/css">
 
        .container {
            width: 768px;
            /*
            min-width: 768px;
            max-width: 1200px;
            */
            padding: 0 10px;
            margin: 0 auto;
        }
 
        .main-header {
            position: relative;
        }
 
        .main-header .main-navigation {
        }
 
        .main-header .main-navigation ul {
            position: relative;
            list-style: none;
            margin: 0;
            padding: 0;
        }
 
        .main-header .main-navigation ul li {
            float: left;
            width: 20%;
        }
 
        .main-header .main-navigation ul li:nth-child(1) {
            margin-left: 6%;
            text-align: left;
        }
        .main-header .main-navigation ul li:nth-child(2) {
            text-align: left;
        }
        .main-header .main-navigation ul li:nth-child(3) {
            margin-left: 8%;
            text-align: right;
        }
        .main-header .main-navigation ul li:nth-child(4) {
            float: right;
            margin-right: 6%;
            text-align: right;
        }
 
        .main-header .main-navigation ul li a {
            display: block;
            padding: 20px 0;
            color: #000;
            background-color: #fff;
            font-weight: bold;
            text-decoration: none;
        }
 
        .main-header .main-navigation ul li a:hover {
            color: #81b3d2;
        }
 
        .main-header .main-navigation ul li a:active {
            color: #cacaca;
        }
 
        .main-header .header-logo {
            position: absolute;
            top: 0;
            left: 50%;
            transform: translateX(-50%);
        }
        .fix{
            position: fixed;
            right: 0;
            bottom: 2%;
 
        }
 
    </style>
 
</head>
<body style="width: 900px; margin: 100px auto; height: auto;">
<header class="main-header container">
    <nav class="main-navigation">
        <ul class="nav-panel clearfix">
            <li>
                <a href="#">Страница 1</a>
            </li>
            <li>
                <a href="#">Страница 2</a>
            </li>
            <li>
                <a href="#">Страница 3</a>
            </li>
            <li>
                <a href="#">Страница 4</a>
            </li>
        </ul>
    </nav>
    <div class="header-logo">
        <img src="image/sbg/logo.png" width="137" height="70" alt="Лого но я его не придумал">
    </div>
</header>
 
    <c:forEach var="name" items="${imageNames}">
        <div id="gallery">
            <a class="fancybox" rel="group" href="images/image/?name=${name}">
            <img style="max-width: 100%; height: auto; padding: 10px;" src="images/image/?name=${name}">
            </a>
            <script type="text/javascript">
                $(document).ready(function() {
                    $(".fancybox").fancybox();
                });
            </script>
        </div>
 
    </c:forEach>
    <br>
<a class="btn btn-lg btn-danger fix " href="javascript:history.back()" role="button">Назад</a>
</body>
</html>
0
Эксперт Java
3639 / 2971 / 918
Регистрация: 05.07.2013
Сообщений: 14,220
25.01.2017, 01:30
Ну и осталось сделать чтоб сервер по указанным путям отдавал нужные ресурсы
0
Эксперт Java
 Аватар для KEKCoGEN
2399 / 2224 / 565
Регистрация: 28.12.2010
Сообщений: 8,672
25.01.2017, 10:46
москвичанатолий, либо пропишите полные пути до скриптов где они в сети лежат, либо положите их на ваш сервер.
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
raxper
Эксперт
30234 / 6612 / 1498
Регистрация: 28.12.2010
Сообщений: 21,154
Блог
25.01.2017, 10:46
Помогаю со студенческими работами здесь

Spring Boot не видит jsp
Просто пишет не удается найти страницу https://www.cyberforum.ru/attachment.php?attachmentid=751100&amp;stc=1&amp;d=1477583216 Вот...

JSP, Spring MVC: invalid url
Есть форма на JSP для загрузки файла: &lt;sf:form action=&quot;././doUpload&quot; modelAttribute=&quot;uploadedFile&quot; method=&quot;POST&quot;...

Jsp+Spring MVC+annotation redirect
Добрый день нужна помощь. Есть home.jsp с формой поиска &lt;div&gt; &lt;form:form modelAttribute=&quot;user&quot;...

Подключение Oracle+maven+spring+Hibernate+jsp
Всем доброго времени суток, друзья помогите разобраться пожалуйста в web-разработке я новичок, и есть много не понятных моментов, которые я...

Spring MVC и много форм в одном jsp
Здравствуйте. Опыта мало, поэтому прошу помощи возможно в совсем банальной вещи. Пишу что-то типа интернет-магазина. Есть список...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
7
Ответ Создать тему
Новые блоги и статьи
Уведомление о неверно выбранном значении справочника
Maks 06.04.2026
Алгоритм из решения ниже реализован на примере нетипового документа "НарядПутевка", разработанного в конфигурации КА2. Задача: уведомлять пользователя, если в документе выбран неверный склад. . .
Установка Qt Creator для C и C++: ставим среду, CMake и MinGW без фреймворка Qt
8Observer8 05.04.2026
Среду разработки Qt Creator можно установить без фреймворка Qt. Есть отдельный репозиторий для этой среды: https:/ / github. com/ qt-creator/ qt-creator, где можно скачать установщик, на вкладке Releases:. . .
AkelPad-скрипты, структуры, и немного лирики..
testuser2 05.04.2026
Такая программа, как AkelPad существует уже давно, и также давно существуют скрипты под нее. Тем не менее, прога живет, периодически что-то не спеша дополняется, улучшается. Что меня в первую очередь. . .
Отображение реквизитов в документе по условию и контроль их заполнения
Maks 04.04.2026
Алгоритм из решения ниже реализован на примере нетипового документа "ПланированиеСпецтехники", разработанного в конфигурации КА2. Данный документ берёт данные из другого нетипового документа. . .
Фото всей Земли с борта корабля Orion миссии Artemis II
kumehtar 04.04.2026
Это первое подобное фото сделанное человеком за 50 лет. Снимок называют новым вариантом легендарной фотографии «The Blue Marble» 1972 года, сделанной с борта корабля «Аполлон-17». Новое фото. . .
Вывод диалогового окна перед закрытием, если документ не проведён
Maks 04.04.2026
Алгоритм из решения ниже реализован на примере нетипового документа "СписаниеМатериалов", разработанного в конфигурации КА2. Задача: реализовать программный контроль на предмет проведения документа. . .
Программный контроль заполнения реквизитов табличной части документа
Maks 02.04.2026
Алгоритм из решения ниже реализован на примере нетипового документа "СписаниеМатериалов", разработанного в конфигурации КА2. Задача: 1. Реализовать контроль заполнения реквизита. . .
wmic не является внутренней или внешней командой
Maks 02.04.2026
Решение: DISM / Online / Add-Capability / CapabilityName:WMIC~~~~ Отсюда: https:/ / winitpro. ru/ index. php/ 2025/ 02/ 14/ komanda-wmic-ne-naydena/
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru