1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【JSP】JSTLを使ってjspを記述する

Last updated at Posted at 2021-04-02

##はじめに
JSTLを使ってjspを記述するために必要な手順を記載します。

##1.jstl-api-1.2.jarファイルダウンロード
https://mvnrepository.com/artifact/javax.servlet.jsp.jstl/jstl-api/1.2

image.png

##2.jstl-impl-1.2.jarファイルダウンロード
https://mvnrepository.com/artifact/org.glassfish.web/jstl-impl/1.2

image.png

##3.ファイル格納
WEB-INF/libに2つのjarファイルを格納する。

##4.jspファイルでjstlを記述

<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html lang="ja">
    <head>
        <meta charset="UTF-8">
        <title>全件検索結果</title>
    </head>
    <body>
        <table border=1>
            <tr><th>id</th><th>title</th><th>content</th></tr>
            <c:forEach var="dto" items="${queryAll}">
                <tr>
                    <td>${dto.id}</td>
                    <td>${dto.title}</td>
                    <td>${dto.content}</td>
                </tr>
            </c:forEach>
        </table>
    </body>
</html>

##参考
https://sukkiri.jp/technologies/libraries/jstl/jstl_install.html

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?