assigning jcr:title to a variable in jsp | Community
Skip to main content
October 16, 2015
Solved

assigning jcr:title to a variable in jsp

  • October 16, 2015
  • 5 replies
  • 1505 views

Hi,

I am trying to do this operation <c:set var="title" value="${page.value.properties["jcr:title"]}" /> in jsp but not being able to do so. The error I am getting is "The attribute prefix jcr does not correspond to any imported tag library". How can I resolve this issue.

Thanks in advance,

Ankit

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by JustinEd3

Hi Ankit,

You seem to have a syntax issue with respect to the quotation marks. You should use:

<c:set var="title" value="${page.value.properties['jcr:title']}" />

Regards,

Justin

5 replies

smacdonald2008
Level 10
October 16, 2015

See this heading "ACCESSING CONTENT" located here:

http://dev.day.com/docs/en/cq/current/developing/components.html

It talks about ways in which to access content in CQ. 

JustinEd3Adobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

Hi Ankit,

You seem to have a syntax issue with respect to the quotation marks. You should use:

<c:set var="title" value="${page.value.properties['jcr:title']}" />

Regards,

Justin

October 16, 2015

Thanks Justin. That really worked. But it works if I use the double quotes and just use the property in JSP rather than assigning it to some variable. Any pointers on that.

Thanks,

Ankit

Adobe Employee
October 16, 2015

Hi Ankit,

Not sure I understand. Can you provide a specific example?

Justin

October 16, 2015

I mean if I just use it in the JSP like <h2>${page.value.properties["jcr:title"]}</h2> it works just fine.

Thanks,

Ankit