Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

access global object in Use class

Avatar

Level 4

Hi

How can i access global Java-backed Objects mentioned in https://docs.adobe.com/docs/en/htl/docs/global-objects.html in a Java class that extends WCMUsePojo.

Thank you

6 Replies

Avatar

Level 10

You can directly invoke these method in the class which extends WCMUsePojo.

Check this documentation https://docs.adobe.com/docs/en/htl/docs/use-api/java.html

Avatar

Level 4

am looking to retrieve java-backed objects mentioned in https://docs.adobe.com/docs/en/htl/docs/global-objects.html . getProperties(), getCurrentPage() methods are available as part of WCMUseOPojo. looking to retrieve other objects (mentioned with variable names in the documentation) like componentContext, log, out, reader, resource etc

Avatar

Employee

They should be already there, otherwise you can use the following:

 ComponentContext context = get("componentContext", ComponentContext.class);

Avatar

Level 4

am looking to retrieve java-backed objects mentioned in https://docs.adobe.com/docs/en/htl/docs/global-objects.html . getProperties(), getCurrentPage() methods are available as part of WCMUseOPojo. looking to retrieve other objects (mentioned with variable names in the documentation) like componentContext, log, out, reader, resource etc

Avatar

Level 10

If you want access to those Global objects - you do not need to use Java - you can access directly from HTML. 

https://docs.adobe.com/docs/en/htl/docs/global-objects.html

Hope this helps.