Advertisement
Guest User

Untitled

a guest
May 17th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. to mój footer i tu wyswietla counter footer.jsp
  2.  
  3. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  4. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  5. "http://www.w3.org/TR/html4/loose.dtd">
  6.  
  7. <div id="footer">
  8. <br>
  9. <hr id="footerDivider">
  10. <p id="footerText" class="reallySmallText">
  11. <a href="#">Privacy Policy</a>
  12. &nbsp;&nbsp;::&nbsp;&nbsp;
  13. <a href="#">Contact</a>
  14. &nbsp;&nbsp;&copy;&nbsp;&nbsp;
  15. 2010 the affable bean</p>
  16. Liczba odslon : ${counter}<br>
  17. </div>
  18. </div>
  19. </body>
  20. </html>
  21.  
  22.  
  23. a tak wyglada moj plik index.jsp i to tyle w sumie:
  24.  
  25. <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  26. <%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
  27. <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
  28. <c:set var='view' value='/index' scope='session' />
  29. <%--
  30. Document : index
  31. Created on : 2016-05-15, 11:29:23
  32. Author : Izabela
  33. --%>
  34.  
  35. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  36. <!DOCTYPE html>
  37. <html>
  38. <head>
  39. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  40. <link href="css/sklep.css" rel="stylesheet" type="text/css"/>
  41. <title>Sklep</title>
  42. </head>
  43.  
  44. <%
  45. Integer counter = (Integer)application.getAttribute("counter");
  46.  
  47. if(counter==null || counter==0) counter=1;
  48. else counter++;
  49. application.setAttribute("counter",counter);
  50. %>
  51.  
  52. <body>
  53.  
  54. <%--<sql:setDataSource var="snapshot" driver="com.mysql.jdbc.Driver"
  55. url="jdbc:mysql://localhost:3306/mojsklep"
  56. user="root" password="lila33"/>
  57.  
  58. <sql:query var="categories" dataSource="${snapshot}">
  59. SELECT * FROM kategoria
  60. </sql:query>--%>
  61.  
  62. <div id="main">
  63.  
  64. <div id="indexLeftColumn">
  65. <div id="welcomeText">
  66. <p style="font-size: larger"><fmt:message key='greeting'/></p>
  67.  
  68. <p><fmt:message key='introText'/></p>
  69. </div>
  70. </div>
  71.  
  72.  
  73. <div id="indexRightColumn">
  74. <c:forEach var="kategoria" items="${categories}">
  75. <div class="categoryBox">
  76. <a href="kategoria?${kategoria.idKategoria}">
  77. <span class="categoryLabel"></span>
  78. <span class="categoryLabelText"><fmt:message key='${kategoria.nazwa}'/></span>
  79.  
  80. <img src="${initParam.categoryImagePath}${kategoria.nazwa}.jpg"
  81. alt="<fmt:message key='${kategoria.nazwa}'/>" class="categoryImage">
  82. </a>
  83. </div>
  84. </c:forEach>
  85. </div>
  86.  
  87. </div>
  88. </body>
  89. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement