In the previous post I told about how to upload file(image) to the database in J2EE application. Now I want to tell how to show this image on page. My toolkit is the same. So i'll use the Primefaces library for the UI.
A little bit another situation, we need to view the products in the Market. I decided to write a little example, that will show the name, image and description on the page. Other information can be retrieved in the same way. So... let's begin.
The part of the .xhtml page that responsible for the viewing of the information:
<h:form...
4.27.2013
8:28 PM
2 comments
In this "how to" I'll tell about the process of the uploading file to the database in J2EE project. My toolkit is consist of Netbeans IDE, Glassfish web server, UI library - Primefaces. Let's consider the example with the internet market.
Let's imagine that you have such an entity as a Product. The fields that described in the entity class are: name, description, price and image.
For now the main objective is to add Product to the database.
The part of the .xhtml page that describes the adding to the database:
<h:form enctype="multipart/form-data">
...
4.19.2013
10:41 PM
No comments
In order to describe the picture in detail we need at least two .xhtml pages and one backend bean.
Let's consider that we have two pages with such a content (use any code you wish instead of <...>. I will describe only navigation effect)
<html>
<h:head>...</h:head><h:body>...
<a href="index.xhtml">Homepage</a>
<a href="publications.xhtml">Publications</a>
...</h:body><html>
Now we need to transform these lines in something that will show us on wich of the pages...
Subscribe to:
Posts (Atom)