Access page and page properties in Java action

Hello, I would like to access page and it's properties in the Java action. I need to read Url property of the configured page. Is there a possibility do do it in Mendix? Thank you in advance, Petro Rogutskyi
2 answers

Hi Petro,


I think you are asking if there is away to retrieve the application url in a java action? If thats the case, all you have to do is add these two lines of code in your java action.


import com.mendix.core.Core;     




and then in the "Begin user code" 

String url = Core.getConfiguration().getApplicationRootUrl();








I don't think its possible to retrieve that url. This question is old but I think is still the case

One work around would to create a javascript function that writes the users url into a string, and then you can pass that string into a microflow. From there you can store the url however you want. Heres a link to the mendix api documentation.



Hi Austin,

Thank you for you answer. Indeed this will help to get the application root url.

However I need to iterate through page url, that may be configured in properties, if it's possible of course. See the image below:

I need that to build a sitemap