Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

object.class.forName() not working

René Kray March 23, 2021

Hi folks:

I've found a lot of examples in the internet how to access any kind of java classes via .class.forName. I've tested this in my user macro:

#set ($string="")
#set ($base64=$string.class.forName('java.util.Base64'))
<pre>
base64: $base64.getClass()
</pre>

that results in "$base64.getClass()" and not as expected in "java.util.Base64".

An implicit initialization with "newInstance()" has changed nothing.

#set ($base64=$string.class.forName('java.util.Base64').newInstance())

Has someone an idea, what's wrong here?

I'm using Confluence 7.4.0 Server.

Thanks

1 answer

0 votes
Ulrik Schoth
Contributor
November 3, 2021

Hi René,

I just ran across the same problem. Have you found a solution in the meantime?

Regards,
Ulrik

René Kray November 3, 2021

Hi Ulrik:

Unfortunately not. The java support in confluence macros does not work as well as expected.

Regards, René

Ulrik Schoth
Contributor
November 3, 2021

Hi René,

meanwhile, I found a posting that gave me the impression that the option of using "object.class.forName()" has gone for security reasons. :-(

Regards,
Ulrik

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, confluence whiteboards, whiteboard templates, template contest, visual collaboration, atlassian learning, confluence community, brainstorming tools, agile planning, team productivity, confluence templates, share your template

Share Your Confluence Whiteboard Template for a Chance to Be Featured in the Product! 🏆

Want to leave your mark on Confluence? One winner will have their whiteboard design added into Confluence for all users to access! This is your chance to showcase your creativity, help others, and gain recognition in the Confluence community.

Share your template today!
AUG Leaders

Atlassian Community Events