Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

assigning jcr:title to a variable in jsp

Avatar

Level 3

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

1 Accepted Solution

Avatar

Correct answer by
Employee

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

0 Replies

Avatar

Level 10

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. 

Avatar

Correct answer by
Employee

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

Avatar

Level 3

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

Avatar

Employee

Hi Ankit,

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

Justin

Avatar

Level 3

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

Thanks,

Ankit