cancel
Showing results for 
Search instead for 
Did you mean: 

getContextName() in WD app running in Portal iView

Former Member
0 Kudos

Does anyone know how to use request.getComponentContext().getContextName() in a Web Dynpro application running in a Portal iView?

I am currently using:

IWDWebContextAdapter iad = WDWebContextAdapter.getWebContextAdapter();

IWebContextAdapter adapter = (IWebContextAdapter) iad;

IPortalComponentRequest request = (IPortalComponentRequest) adapter.getOriginContext();

String navTarget = request.getComponentContext().getContextName();

which compiles ok, and I have added the prtapi.jar to my project. But everytime I run this I get a java.lang.NoClassDefFoundError for com/sapportals/portal/prt/component/IPortalComponentRequest

What I am trying to do is get the PCD location for the iView in which the application is running to use in WDPortalNavigation.

Any ideas??

Thanks,

-Kevin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

This error might be because the prtapi.jar is not recognized.

Instead of adding it as an external jar,try the below:

1)Copy the jar file and paste it in the lib folder.

2)Then in the java build path --> libraries >Addjars>

add ur jar.

Hope this helps.

Regards,

Rathna.

Former Member
0 Kudos

Thank you so much for the reply Rathna.

I copied the jar file to the lib folder. But when I try to "Add Jar" rather than "Add External Jar", it says "No Entries Available" and the selection screen is disabled.

How do I reference my WD project in order to select the jar file i copied into the lib folder?

Thanks,

-Kevin

Former Member
0 Kudos

Hi

If u click "Add Jar" it will list out all the projects that are opened from which u can select

ur project>lib>jar file.

I can see the list of opened projects if i try to add jar.

Also Please check whether u have added the jar file in the lib folder of the project u need to add.

Regards,

Rathna.

Answers (0)