how to load database data on jsp jstl screen

Asked

Viewed 9 times

-1

ola have a jsp and jstl screen on the java system, on this screen loads database data by select, screen codico:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Mostrar Imagem</title>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<style type="text/css">
*{
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

html, body{
    height: 100%;
    background-attachment: fixed;
    background-image: url("https://p.favim.com/orig/2018/11/11/90s-coffee-vaporwave-Favim.com-6565459.gif");
    background-size: 100% 100%;
    background-repeat: no-repeat;
}
</style>
</head>
<body>
    <a style="font-size: 25px; color: violet" href="ServletFileUpload?acao=carregarPag1">Carregar arquivos</a><!-- chama a servlet e ja entra por doGet por ser padrao, por isso n e preciso especificar -->
    <br>
    <form action="<%=request.getContextPath()%>/ServletFileUpload" method="GET">
        <table>
            <c:forEach items="${listaUserImagem}" var="user">
                <tr style="color: white;">
                    <td>${user.id}</td>
                    <td> <img width="100" height="100" alt="" src="${user.imagem}"> </td>
                    <td>${user.texto}</td>
                    <td>
                        <iframe src="${user.video}" frameborder="0" allowfullscreen></iframe>
                    </td>
                </tr>
            </c:forEach>
        </table>
    </form>
    
    <jsp:include page="whatsappButton.html"></jsp:include>
</body>
</html>

so in this way it loads properly but loads all the data in each <td>, I wanted to know a way to put only one at a time, like where I carry the text, how could I do to put each one in one <p>, type I have two <p> as I do to press the first <p> only one bank die and another <p> load other data from the bank?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.