Forum Discussion

santosh_csc's avatar
7 years ago

How to get path parameter of URL inside component?

In reply to a private message page, I want to get the message ID. How can I get that number?

 

If there is no freemarker Object has this info, then I can extract the number 25 from URL https://community.lithium.com/t5/notes/composepage/note-id/25.

 

Is there any way to get the ID something like

http.request.parameters.name.get("message-subject","")

instead of taking the URL and split it. 

 

  • Hi Santosh,

    You can achieve this by the following lines of code:

    <#assign MessageId = webuisupport.path.parameters.name.get("note-id") >

    Note ID: ${MessageId.noteId }

    Let me know if this was helpful.
  • Hi Santosh,

    You can achieve this by the following lines of code:

    <#assign MessageId = webuisupport.path.parameters.name.get("note-id") >

    Note ID: ${MessageId.noteId }

    Let me know if this was helpful.
  • santosh_csc - 

     

    You can achieve this by 

     

     

    ${http.request.url?split("note-id")[1]}

    You can not get note-id using http.request.parameters.name.get object