URL path parameters

I noticed that in the call for the for REST API, for example, we could have url like this:

https://domain.com/rest/s1/componentRestApi/product/106151/content/106153

in which 106151 and 106153 could be any legal entity primary key of product and ProductContent. They are defined by source id in definition of API.

But for a url path for a screen path, how could we do the similar? I know there is a mechanism called extra path parameters. Those parameters can only be handled in one screen file. Is it possible that we could have a screen def file for product, then in this screen def file, we handle product with primary 106151, then we go to sub screen def file for content, then handle content with primary key 106153?

If I understand what you mean, you would have a screen for Product at https://domain.com/app/product/106151, and a screen for ProductContent at https://domain.com/app/product/106151/content/106153. I don’t know of a way to do that off the top of my head. It might be possible. My question is why not just have a screen for
https://domain.com/app/product/106151
https://domain.com/app/productcontent?productId=106153&productContent=106151. That’s typically how that is done in Moqui, and that’s how I would do it unless there’s a good reason otherwise. I could be wrong though let me know.

1 Like

You are right about this. I just do not like the parameter ways and try to make it using url path. And I also thought that the tree path would be more logic in some scence. Anyway, I did it in the sample way as you suggested.

1 Like