Dies ist meine erste Post auf Stapel, und ich möchte insbesondere den Gründern dieser großen Website danken.unmöglich zu zeigen Alle Bilder von Tomcat 8 Webapps
Meine Frage scheint ein Duplikat dessen zu sein, was bereits existiert. Ich möchte jedoch darauf hinweisen, dass dies nicht der Fall ist. Seit einigen Wochen habe ich eine Reihe von Recherchen über das Internet durchgeführt und fand diese Antwort, die mir helfen könnte. Aber nachdem ich es versucht hatte, bekam ich keine Lösung.
Simplest way to serve static data from outside the application server in a Java web application
Hier ist mein Problem:
Ich bin mit Kater 8 und meine Bilder sind in C: \ Server \ Tomcat \ webapps \ uploadimg \ pa \ imgstsore
Der Name jedes Bildes wird in einer Datenbank gespeichert.
Der folgende Jsp-Code soll alle meine Bilder anzeigen. Leider wird nur das Bild für mein Logo angezeigt. On-Lösung bitte
<% @ taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core" %>
<!--Logo -->
<c:if test="${p.imgLargeur == 220}">
<table>
<tr>
<td><img width="220" height="200" **src="http://localhost:8080/uploadimg/pa/imgstore/${p.imgApropos}">** </td>
<td style="font-size: 14pt;text-align: center;width:710px" >Logo ${p.apropos}</td>
</tr>
</table><br>
</c:if>
<!--image with text by the side -->
<c:if test="${p.imgLargeur == 200}">
<table>
<tr>
<td colspan="2" style="font-size: 16pt;font-weight: bold;color: darkblue">${p.titre}</td>
</tr>
<tr style="height: 10px"></tr>
<tr>
<td>
<td><img width="220" height="200" **src="http://localhost:8080/uploadimg/pa/imgstore/${p.imgApropos}">** </td>
</td>
<td style="font-size: 14pt;text-align: justify;width:710px">${p.apropos}</td>
</tr>
</table><br>
</c:if>
<!--image with text under -->
<c:if test="${p.imgLargeur == 600}">
<table>
<tr>
<td colspan="2" style="font-size: 16pt;font-weight: bold;color: darkblue">${p.titre}</td>
</tr>
<tr style="height: 10px"></tr>
<tr>
<td>
<td><img width="600" height="400" **src="http://localhost:8080/uploadimg/pa/imgstore/${p.imgApropos}">** </td>
</td>
</tr>
<tr>
<td style="font-size: 14pt;text-align: justify;width:710px">${p.apropos}</td>
</tr>
</table><br>
</c:if>
<!--Text without image -->
<c:if test="${p.imgLargeur == 0}">
<table>
<tr>
<td colspan="2" style="font-size: 14pt;font-weight: bold;color: darkblue">${p.titre}</td>
</tr>
<tr style="height: 10px"></tr>
<tr>
<td style="font-size: 14pt;text-align: justify;width:710px">${p.apropos}</td>
</tr>
</table><br>
</c:if>
</c:forEach>