On creation of a new JSP dynpage portal component in a portal application project in NWDS, you see compilation errors on all the import statements. This can be rectified by adding certain required external jars for your project. I thought I would share this information as a step wise manual so that it will be easy for you to locate the JAR files and add them to your project in no time. Please follow the below steps carefully.
Step 1:I created a new portal application project named JarClassFinder. In src.core of my project I created a new package com.sap.learning. In that package I created a new jspdynpage portal component with name ClassFinder and the Jsp Name as ClassFinderJSP as shown below
Step 2: As you can see in the below screenshot on the creation of your new project with jspdynpage component you can see many compilation errors on import statements.
Step 3: These compilation errors exist because the necessary jar files have not been added to your project. We can make use of IBM jarclass finder to find the required jar files for your project easily and add them to your project build path. A blog has been written already in SDN on how to download the IBM jarclass finder and how to make the jarclassfinder available on your Netweaver IDE. Below is the link for the above referred blog.
Step 4: Once you have read this blog you will be able to get an idea on jar class finder. After you have followed the steps in the above blog the jarclass finder will be available on your IDE. You can access the jar class finder by an icon on the toolbar as shown in the below screenshot.
Step 5: By clicking the above icon a pop up comes which asks you necessary search parameters for your jar files.
Basically we need to primarily add two external jars i.e.
Let’s first search the first jar and in the pop up when you click class finder icon, let’s give htmlb as the search parameter and C:Program FilesSAPIDEIDE70eclipseplugins as your search directory.
Step 6: Once you click ‘Find’ the jar class finder searches all the jar files based on the search parameter and gives you the result jar files in Jar Class Finder View. As you can see in the below screenshot a list of jar files have been populated in Jar Class Finder View.
Scroll down to find “com.sapportals.portal.htmlb.HtmlbPortalComponent”.
Right click “com.sapportal.portal.htmlb.HtmlbPortalComponent” and select Add to project build Path
Once you have added the jar file the IDE gives you a pop up message on successful addition of your jar file
Step 8: As you can see in the below screenshot one more error still exists. The description tells you that you have to add also “com.sapportals.htmlb.page.Dynpage” jar file in order to get rid of this compilation error.
Step 9: Now let’s search again the jar file using jarclass finder. Give the search parameter as “Dynpage” now and the drive as C:Program FilesSAPIDEIDE70eclipseplugins.
Once you search you would be able to see “com.sapportals.htmlb.page.Dynpage” in the result classjarfiles populated in the Jar Class Finder View.
Add the jar file onto your project build path as mentioned above and with the successful addition you get a pop up message.
As you can see in the below screenshot your project is free of errors are ready for further development.
This way the IBM jarclass finder makes the process easier and you will be able to add the necessary jar files in no time.