Working with Images in ADF-Enabled Web Pages

If the data objects of your business services contains images, you can create a multipart form to access those images in your ADF-enabled web page. However, after you drop the databound input form into your page, you must customize the form to use enctype="multipart/form-data and a File Input Field component type to display the image.

Note: Model 1 JSP developers working with JSP pages must enable file uploading by registering the provided oracle.ord.im.OrdMultipartFilter servlet filter . This filter will look at the request and do the proper parameter parsing to handle the multipart encoding type.

To edit the web page to display images in a multipart form:

  1. Open the Data Control Palette for the ADF-enabled web page that you want to design.

  2. In the Data Control Palette, select the data collection that contains the image attribute.

  3. Select the Input Form type from the dropdown list.

  4. Drag the data collection as Input Form into the open web page.

  5. With the same data collection selected in the Data Control Palette, insert Navigation Buttons into the web page. This lets users traverse the data objects of the collection while displaying the form.

  6. In the Visual Editor, click Code and edit the <html:form> tag to use multipart encoding:

    <html:form action="/dataAction1.do" enctype="multipart/form-data" >

  7. In the input form change the <html:text> entry for Image to a File Input Field component type. After the change the entry will look like:

    
    <tr> 
    
         <td><c:out value="${bindings.Image.label}"></c:out>>/td> 
    
         <td><html:file property="Image"></html:file>>/td> 
    
    </tr>        

If you have created a Struts page flow, you can run the data action and display the form with images.

If you are not working with Struts and have a Model 1 web page, you need to register a Servlet filter in your application's web.xml file to enable file uploading.

To enable image file uploading for Model 1 web pages:

  1. To display the deployment descriptor editor, right-click web.xml in your WEB-INF folder and choose Properties.

  2. Select the Filters node and click New to define the filter:

    Filter Name: OrdMultipartFilter

    Filter Class: oracle.ord.im.OrdMultipartFilter

  3. Select the Filter Mapping node and click Add to define the mapping:

    Filter Name: OrdMultipartFilter

    URL Pattern: /*


Creating the Struts Page Flow for the Oracle ADF Application
Running the Oracle ADF Application from the Page Flow Diagram

 

Copyright © 1997, 2004, Oracle. All rights reserved.