Skip to content

Commit

Permalink
jd03_08 completed.
Browse files Browse the repository at this point in the history
  • Loading branch information
georgekras committed Mar 13, 2018
1 parent 11e583b commit 29325d1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/by/it/krasutski/project/webapp/WEB-INF/tags/menu.tag
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"
%><%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"
%><%@ attribute name="command" required="true" rtexprvalue="true" type="java.lang.String"
%><%@ attribute name="text" required="true" rtexprvalue="true" type="java.lang.String"
%><%
if (command.equalsIgnoreCase(request.getParameter("command"))){
request.setAttribute("menuClassActive"," class='nav-item active'");
}
else
{
request.removeAttribute("menuClassActive");
};
%><li${menuClassActive}>
<a class="nav-link" href="do?command=${command}">${text}</a>
</li>



12 changes: 12 additions & 0 deletions src/by/it/krasutski/project/webapp/WEB-INF/tags/paginator.tag
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<%@ attribute name="count" required="true" rtexprvalue="true" type="java.lang.Integer"%>
<%@ attribute name="step" required="true" rtexprvalue="true" type="java.lang.Integer"%>
<%@ attribute name="urlprefix" required="true" rtexprvalue="true" type="java.lang.String"%>
<%
out.println(" PAGE:");
for (int i = 0; i <= count/step; i++) {
out.println(String.format("&nbsp<a href='%s%d'>%d</a>",urlprefix,i*step,i+1));
}
%>

0 comments on commit 29325d1

Please sign in to comment.