Skip to main content
Oct 16, 2015 2:26 AM UTC
Solved

assigning jcr:title to a variable in jsp

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.
JustinEd3Accepted solution
Adobe Employee
Oct 16, 2015 2:26 AM UTC

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

Oct 16, 2015 2:26 AM UTC

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

Thanks,

Ankit

Translate
Adobe Employee
Oct 16, 2015 2:26 AM UTC

Hi Ankit,

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

Justin

Translate
Oct 16, 2015 2:26 AM UTC

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

Translate
JustinEd3Adobe EmployeeAccepted solution
Adobe Employee
Oct 16, 2015 2:26 AM UTC

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

Translate
smacdonald2008
Level 10
Oct 16, 2015 2:26 AM UTC

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. 

Translate