Results 1 to 8 of 8
Thread: Dynamic display of images
- 01-12-2009, 07:33 PM #1
Member
- Join Date
- Jan 2009
- Posts
- 5
- Rep Power
- 0
Dynamic display of images
Hello,
I when I run the web application (Java server pages and database MySql), in prewiew I have a problem with the display of the images extract from the database.
I view al the record of the database but I dont view the images.
I dont understand because i have this problem.
Help me please.
- 01-13-2009, 03:35 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
How did you do that? Can you show it here?
- 01-13-2009, 09:18 AM #3
Member
- Join Date
- Jan 2009
- Posts
- 5
- Rep Power
- 0
Here my JSP:
I have signed the record of Photo in red.Java Code:<sql:query var="rsResult" dataSource="jdbc/Roberto"> SELECT * FROM portfolio </sql:query> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <h1>Gestione Portfolio</h1> <br> <a href="">Inserisci un nuovo record</a> <br> <c:set var="noOfRows" value="6" /> <sql:query var="rsGestionePortfolio" dataSource="jdbc/Roberto" sql="SELECT * FROM portfolio" startRow="${param.start}" maxRows="3"> </sql:query> <c:choose> <c:when test="${rsGestionePortfolio.rowCount == 0}"> Spiacente non ci sono pił record da visualizzare </c:when> <c:otherwise> Elenco dei lavori eseguiti <table border="1"> <!-- column headers --> <tr> <th>Ordine</th> <th>Nome del dominio</th> <th>Indirizzo web</th> <th>Note</th> <th>didascalia</th> </tr> <!-- column data --> <c:forEach var="row" items="${rsGestionePortfolio.rows}"> <tr> <form action="aggiornaPortfolio.jsp" method="post"> <td><input type="text" name="ordine" value="${row.ordine}" /></td> <td><input type="text" name="nomeDominio" value="${row.nomeDominio}" /></td> <td><input type="text" name="indirizzoWeb" value="${row.indirizzoWeb}" /></td> <td><input type="text" name="note" value="${row.note}" /></td> <td> [COLOR="Red"]<img src="public/portfolio/${row.didascalia}" alt="'.${row.nomeDominio}.'" border="0"/>[/COLOR]</td> <td><input type="submit" value="Aggiorna"><input type="hidden" size="1" name="id_portfolio" value="${row.id_portfolio}" /></td> </form> <td> <form action="" method="post"> <input type="submit" value="Elimina"><input type="hidden" name="id_portfolio" size="1" value="${row.id_portfolio}" /> </form> </td> </tr> </c:forEach> </table> </c:otherwise> </c:choose> </br> <!--- Inizio script paginazione ----> <c:choose> <c:when test="${param.start > 0}"> <a href=""> Previous page</a> </c:when> <c:otherwise> Previous page </c:otherwise> </c:choose> <c:choose> <c:when test="${rsGestionePortfolio.limitedByMaxRows}"> <a href=""> Next page </a> </c:when> <c:otherwise> Next page </c:otherwise> </c:choose> <!---- Fine script paginazione ----> </body> </html>
:)
- 01-13-2009, 09:32 AM #4
Senior Member
- Join Date
- Dec 2008
- Location
- Hong Kong
- Posts
- 473
- Rep Power
- 5
i have a question, we can directly use ${varName} ?
or we should use <c:out value="${varName}" />?
- 01-13-2009, 02:36 PM #5
Member
- Join Date
- Jan 2009
- Posts
- 5
- Rep Power
- 0
I try this solution but the result is the same:
:confused:Java Code:<img src="<c:out value="public/portfolio/${row.didascalia}"/>" border="0"/>
- 01-14-2009, 03:46 AM #6
Senior Member
- Join Date
- Dec 2008
- Location
- Hong Kong
- Posts
- 473
- Rep Power
- 5
then...
is the img path correct?
"public" folder is the subfolder of the folder store this jsp?Last edited by mtyoung; 01-14-2009 at 03:52 AM.
- 01-14-2009, 09:32 AM #7
Member
- Join Date
- Jan 2009
- Posts
- 5
- Rep Power
- 0
I have the JSP file and the path "Public" under the directory "web".
Here the structure:
Web
...|
..index.jsp
...|
..Public
.......|
......Portfolio
:)
- 01-15-2009, 02:55 PM #8
Member
- Join Date
- Jan 2009
- Posts
- 5
- Rep Power
- 0
Sorry I have a doubt.
web.xml file to view images from the database.
Here is my web.xml file:
Java Code:<session-config> <session-timeout> 30 </session-timeout> </session-config> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <resource-ref> <description>Database per amministrazione contenuti sito Roberto</description> <res-ref-name>jdbc/Roberto</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope> </resource-ref> <context-param> <param-name> javax.servlet.jsp.jstl.sql.maxRows </param-name> <param-value> 100 </param-value> </context-param> <context-param> <param-name> javax.servlet.jsp.jstl.sql.parseDate </param-name> <param-value> dd/MM/yy </param-value> </context-param> </web-app>
Similar Threads
-
How to display a list of items and on click display subitems?
By mandyj in forum New To JavaReplies: 8Last Post: 12-29-2008, 07:12 AM -
Dynamic Table using JSP
By banie in forum JavaServer Pages (JSP) and JSTLReplies: 2Last Post: 08-27-2008, 03:13 AM -
How to display information about the display device in SWT
By Java Tip in forum SWTReplies: 0Last Post: 06-28-2008, 09:26 PM -
display images in a Web Application based on java/jsp
By mnsse in forum Advanced JavaReplies: 0Last Post: 03-25-2008, 12:45 AM -
Dynamic DecimalFormatter
By felixtfelix in forum New To JavaReplies: 0Last Post: 03-17-2008, 04:16 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks