cancel
Showing results for 
Search instead for 
Did you mean: 

Need help regarding IResource API

Former Member
0 Kudos

Hi ,

we have custom application built in 7.0 where we use IResource API to get the resource url .

our resource is HTML file stored in jsp folder . we pass this URL some other application to access it

resource url is like below in 7.0 . when we paste this url into browser we can access the resource .

code is

     IPortalComponentRequest req = (IPortalComponentRequest)this.getRequest();

       String componentName = req.getComponentContext().getComponentName();

       IResource htmlfile = req.getResource(componentName, IResource.STATIC_PAGE, "jsp/multipleinstance.html");

and htmlfile.getresourceinformation().getURL is concated with server URL and URL is sent to other application . URL looks like below

http://<host>:<port>/irj/portalapps/<component class>/jsp/multipleinstance.html

we migrated this application to portal DC in  EP 7.3 and we are not able to access the url using above code .

when i paste this url which is generated its not able to load the resource .

when we created standalone portal application it works fine in EP 7.3  .

http://<host>:<port>/<component name>/jsp/multipleinstance.html

Not sure why there is an issue with DC application . please help me .

Accepted Solutions (1)

Accepted Solutions (1)

dror_last
Active Participant
0 Kudos

Please clarify where your jsp folder resides.

If you want to access static resources they all should be above the PORTAL-INF/WEB-INF folder directly under the dist folder in your portal project.

I suggest that you create an html folder for such static resources.

JSP resources should reside and usually reside in the private part of the application below the WEB-INF folder as the access to them is not as a static resource.

Best Regards,

Dror.

Former Member
0 Kudos

Hi Dror ,

Yes , we defiend new JSP folder ouside the PORTAL-INF under dist folder .

i changed to that another folder html but still we are not able to access the resource using full URL

the resource url comes out to be like below when i use resoiurce API .

/demo.sap.com~prtstnad/html/test.html

we added the SAP server URL in order to access i.e like below

http://<host >:<port>//demo.sap.com~prtstnad/html/test.html

when i use portal application (not DC ) it works fine

Answers (1)

Answers (1)

Former Member
0 Kudos

its working ....