Wednesday, August 27, 2014

Retrieve the blob images from database and display them on screen in Oracle ADF?

When we store the images in database using blog type, we would like to retrieve them and display them on the screen. This can be done by creating a servlet and configuring it in the web.xml using the following steps

Step1 Create jsff with the af:image component and configure the source as below. The parameters that we send to the servlet should be enough to send as bind parameters to the image table and retrieve the image


Step2 Create the servlet to retrieve the image from the database as below

























Step3 Configure the web.xml as shown below



Notes

1. Parameters passed to the servlet via af:image source tag should change then only the image on the screen will be refreshed, so better to pass the version number

2. If this application is deployed as library and used as dependency in another application, configure the servlet in the application from where this library is being referenced

Replicate the Wndows/Unix folder structure using af:tree component in ADF

Sometimes we would like to display the windows or unix folder structure directly to the user. We can achieve this using the af:tree component in ADF. We have to programmatically construct the af:tree component to achieve the same

Step 1: Create a POJO class with the members you wish to display on the screen

















    Step2   Construct the tree model as below


 Step3   Refer the folderTree Tree model in the jsff as below