Home > Java, Web Dynpro > Web Dynpro Java – use external library

Web Dynpro Java – use external library

October 25th, 2010 Leave a comment Go to comments

During the web dynpro development, the developer might need to utilize external libraries to realize some specific activities, such as generating excel files, sending emails. Generally there are two methods to adding the external library into the web dynpro application.

1. Package the external libraries into the web dynpro application

Below steps works well in NW7.0. I didn’t test it in NW CE7.1 and not sure whether it works or not in NW CE7.1.

Step 1. Create a development component with type external library.

external library

Step 2. Store the external JAR files into the libraries folder of the external library dc.

Step 3. Expose the JAR files in two separate public parts, one with purpose assembly and another one with purpose compilation.

public part

Step 4. In the web dynpro application, expand DC Definition and add new create external library dc into Used DCs. You need add the external library dc two times. One is for compilation public part with dependency type Build Time, the other is for assembly public part with dependency type Build Time.

add public part

Step 5. Build the web dynpro application, you will find the external library is packed into the deploy files.

web dynpro package

2. Deploy the external library as a standalone J2EE Server Component

The second option is to create a J2EE Server Component/Library DC(This is for NW7.0. In NW CE 7.1, DC type will be Java EE/Enterprise Application. For more information, please refer below link) and deploy it to the application server directly. In the web dynpro application, a library reference needs to be added to address the external library during runtime.

For more information of this method, please refer to How to use external JAR files in Web Dynpro development components in SDN. It also discuss the difference between NW7.0 and NW CE7.1.

extlibdcinwd_nw70

  1. No comments yet.
  1. No trackbacks yet.