Skip to content

Commit

Permalink
Make jsp code easy to see
Browse files Browse the repository at this point in the history
  • Loading branch information
k-tamura committed Oct 26, 2017
1 parent 0109e8b commit c7b736d
Show file tree
Hide file tree
Showing 5 changed files with 700 additions and 728 deletions.
117 changes: 55 additions & 62 deletions src/main/webapp/dfi/includable.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="language"
value="${not empty param.language ? param.language : not empty language ? language : pageContext.request.locale}"
scope="session" />
<c:set var="language" value="${not empty param.language ? param.language : not empty language ? language : pageContext.request.locale}" scope="session" />
<fmt:setLocale value="${language}" />
<fmt:setBundle basename="messages" />
<!DOCTYPE html>
Expand All @@ -13,67 +11,62 @@
<title><fmt:message key="title.design.test.page" /></title>
<link rel="icon" type="image/vnd.microsoft.icon" href="${pageContext.request.contextPath}/images/favicon.ico">
<c:catch var="ex">
<c:if test="${param.template != null && !fn:contains(param.template,'../') && !fn:startsWith(param.template,'/')}">
<c:import url="<%= request.getParameter(\"template\")%>" />
</c:if>
<c:if test="${param.template != null && !fn:contains(param.template,'../') && !fn:startsWith(param.template,'/')}">
<c:import url="<%=request.getParameter(\"template\")%>" />
</c:if>
</c:catch>
</head>
<body style="margin-left: 20px; margin-right: 20px;">
<table style="width: 100%;">
<tr>
<td>
<h2>
<span class="glyphicon glyphicon-globe"></span>&nbsp;
<fmt:message key="title.design.test.page" />
</h2>
</td>
<td align="right"><a href="${pageContext.request.contextPath}/"><fmt:message key="label.go.to.main" /></a>
</td>
</tr>
</table>
<hr style="margin-top: 0" />
<header>
<table style="width:720px;">
<tr>
<td><img src="${pageContext.request.contextPath}/images/easybuggy.png"></td>
<td><fmt:message key="description.design.page" /></td>
</tr>
</table>
</header>
<hr style="margin-top:10px"/>
<p>
<fmt:message key="description.design.test" />
</p>
<ul>
<li><p>
<a href="includable.jsp"><fmt:message
key="style.name.nonstyle" /></a>:
<fmt:message key="style.description.nonstyle" />
</p></li>
<li><p>
<a href="includable.jsp?template=style_bootstrap.html"><fmt:message
key="style.name.bootstrap" /></a>:
<fmt:message key="style.description.bootstrap" />
</p></li>
<li><p>
<a href="includable.jsp?template=style_google_mdl.html"><fmt:message
key="style.name.google.mdl" /></a>:
<fmt:message key="style.description.google.mdl" />
</p></li>
<li><p>
<a href="includable.jsp?template=style_materialize.html"><fmt:message
key="style.name.materialize" /></a>:
<fmt:message key="style.description.materialize" />
</p></li>
</ul>
<br>
<div class="alert alert-info" role="alert">
<span class="glyphicon glyphicon-info-sign"></span>&nbsp;
<fmt:message key="msg.note.dangerous.file.inclusion" />
</div>
<hr>
<footer>
<img src="/images/easybuggyL.png">Copyright &copy; 2016-17 T246 OSS Lab, all rights reserved.
</footer>
<table style="width: 100%;">
<tr>
<td>
<h2>
<span class="glyphicon glyphicon-globe"></span>&nbsp;
<fmt:message key="title.design.test.page" />
</h2>
</td>
<td align="right"><a href="${pageContext.request.contextPath}/"><fmt:message key="label.go.to.main" /></a></td>
</tr>
</table>
<hr style="margin-top: 0" />
<header>
<table style="width: 720px;">
<tr>
<td><img src="${pageContext.request.contextPath}/images/easybuggy.png"></td>
<td><fmt:message key="description.design.page" /></td>
</tr>
</table>
</header>
<hr style="margin-top: 10px" />
<p>
<fmt:message key="description.design.test" />
</p>
<ul>
<li><p>
<a href="includable.jsp"><fmt:message key="style.name.nonstyle" /></a>:
<fmt:message key="style.description.nonstyle" />
</p></li>
<li><p>
<a href="includable.jsp?template=style_bootstrap.html"><fmt:message key="style.name.bootstrap" /></a>:
<fmt:message key="style.description.bootstrap" />
</p></li>
<li><p>
<a href="includable.jsp?template=style_google_mdl.html"><fmt:message key="style.name.google.mdl" /></a>:
<fmt:message key="style.description.google.mdl" />
</p></li>
<li><p>
<a href="includable.jsp?template=style_materialize.html"><fmt:message key="style.name.materialize" /></a>:
<fmt:message key="style.description.materialize" />
</p></li>
</ul>
<br>
<div class="alert alert-info" role="alert">
<span class="glyphicon glyphicon-info-sign"></span>&nbsp;
<fmt:message key="msg.note.dangerous.file.inclusion" />
</div>
<hr>
<footer>
<img src="/images/easybuggyL.png">Copyright &copy; 2016-17 T246 OSS Lab, all rights reserved.
</footer>
</body>
</html>
109 changes: 50 additions & 59 deletions src/main/webapp/dt/includable.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -2,73 +2,64 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="language"
value="${not empty param.language ? param.language : not empty language ? language : pageContext.request.locale}"
scope="session" />
<c:set var="language" value="${not empty param.language ? param.language : not empty language ? language : pageContext.request.locale}" scope="session" />
<fmt:setLocale value="${language}" />
<fmt:setBundle basename="messages" />
<!DOCTYPE html>
<html>
<head>
<title><fmt:message key="title.design.test.page" /></title>
<link rel="icon" type="image/vnd.microsoft.icon" href="${pageContext.request.contextPath}/images/favicon.ico">
<c:import url="/dfi/style_bootstrap.html" />
<c:import url="/dfi/style_bootstrap.html" />
</head>
<body style="margin-left: 20px; margin-right: 20px;">
<table style="width: 100%;">
<tr>
<td>
<h2>
<span class="glyphicon glyphicon-globe"></span>&nbsp;
<fmt:message key="title.design.test.page" />
</h2>
</td>
<td align="right"><a href="${pageContext.request.contextPath}/"><fmt:message key="label.go.to.main" /></a>
</td>
</tr>
</table>
<hr style="margin-top: 0" />
<!-- header section start -->
<c:catch var="ex">
<c:if
test="${param.template != null && !fn:startsWith(param.template,'http')}">
<c:import
url="<%= request.getParameter(\"template\") + \"_header.html\" %>" />
</c:if>
</c:catch>
<!-- header section end -->
<p>
<fmt:message key="description.design.test" />
</p>
<ul>
<li><p>
<a href=includable.jsp><fmt:message key="style.name.noframe" /></a>:
<fmt:message key="style.description.noframe" />
</p></li>
<li><p>
<a href="includable.jsp?template=basic"><fmt:message
key="style.name.basic" /></a>:
<fmt:message key="style.description.basic" />
</p></li>
<li><p>
<a href="includable.jsp?template=monochro"><fmt:message
key="style.name.monochro" /></a>:
<fmt:message key="style.description.monochro" />
</p></li>
</ul>
<br>
<div class="alert alert-info" role="alert">
<span class="glyphicon glyphicon-info-sign"></span>&nbsp;
<fmt:message key="msg.note.path.traversal" />
</div>
<!-- footer section start -->
<c:catch var="ex">
<c:if
test="${param.template != null && !fn:startsWith(param.template,'http')}">
<c:import
url="<%= request.getParameter(\"template\") + \"_footer.html\" %>" />
</c:if>
</c:catch>
<!-- footer section end -->
<table style="width: 100%;">
<tr>
<td>
<h2>
<span class="glyphicon glyphicon-globe"></span>&nbsp;
<fmt:message key="title.design.test.page" />
</h2>
</td>
<td align="right"><a href="${pageContext.request.contextPath}/"><fmt:message key="label.go.to.main" /></a></td>
</tr>
</table>
<hr style="margin-top: 0" />
<!-- header section start -->
<c:catch var="ex">
<c:if test="${param.template != null && !fn:startsWith(param.template,'http')}">
<c:import url="<%=request.getParameter(\"template\") +\"_header.html\"%>" />
</c:if>
</c:catch>
<!-- header section end -->
<p>
<fmt:message key="description.design.test" />
</p>
<ul>
<li><p>
<a href=includable.jsp><fmt:message key="style.name.noframe" /></a>:
<fmt:message key="style.description.noframe" />
</p></li>
<li><p>
<a href="includable.jsp?template=basic"><fmt:message key="style.name.basic" /></a>:
<fmt:message key="style.description.basic" />
</p></li>
<li><p>
<a href="includable.jsp?template=monochro"><fmt:message key="style.name.monochro" /></a>:
<fmt:message key="style.description.monochro" />
</p></li>
</ul>
<br>
<div class="alert alert-info" role="alert">
<span class="glyphicon glyphicon-info-sign"></span>&nbsp;
<fmt:message key="msg.note.path.traversal" />
</div>
<!-- footer section start -->
<c:catch var="ex">
<c:if test="${param.template != null && !fn:startsWith(param.template,'http')}">
<c:import url="<%=request.getParameter(\"template\") +\"_footer.html\"%>" />
</c:if>
</c:catch>
<!-- footer section end -->
</body>
</html>
Loading

0 comments on commit c7b736d

Please sign in to comment.