Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- to mój footer i tu wyswietla counter footer.jsp
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
- <div id="footer">
- <br>
- <hr id="footerDivider">
- <p id="footerText" class="reallySmallText">
- <a href="#">Privacy Policy</a>
- ::
- <a href="#">Contact</a>
- ©
- 2010 the affable bean</p>
- Liczba odslon : ${counter}<br>
- </div>
- </div>
- </body>
- </html>
- a tak wyglada moj plik index.jsp i to tyle w sumie:
- <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
- <%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
- <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
- <c:set var='view' value='/index' scope='session' />
- <%--
- Document : index
- Created on : 2016-05-15, 11:29:23
- Author : Izabela
- --%>
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <link href="css/sklep.css" rel="stylesheet" type="text/css"/>
- <title>Sklep</title>
- </head>
- <%
- Integer counter = (Integer)application.getAttribute("counter");
- if(counter==null || counter==0) counter=1;
- else counter++;
- application.setAttribute("counter",counter);
- %>
- <body>
- <%--<sql:setDataSource var="snapshot" driver="com.mysql.jdbc.Driver"
- url="jdbc:mysql://localhost:3306/mojsklep"
- user="root" password="lila33"/>
- <sql:query var="categories" dataSource="${snapshot}">
- SELECT * FROM kategoria
- </sql:query>--%>
- <div id="main">
- <div id="indexLeftColumn">
- <div id="welcomeText">
- <p style="font-size: larger"><fmt:message key='greeting'/></p>
- <p><fmt:message key='introText'/></p>
- </div>
- </div>
- <div id="indexRightColumn">
- <c:forEach var="kategoria" items="${categories}">
- <div class="categoryBox">
- <a href="kategoria?${kategoria.idKategoria}">
- <span class="categoryLabel"></span>
- <span class="categoryLabelText"><fmt:message key='${kategoria.nazwa}'/></span>
- <img src="${initParam.categoryImagePath}${kategoria.nazwa}.jpg"
- alt="<fmt:message key='${kategoria.nazwa}'/>" class="categoryImage">
- </a>
- </div>
- </c:forEach>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement