Expand my Community achievements bar.

SOLVED

assigning jcr:title to a variable in jsp

Avatar

Former Community Member

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

View solution in original post

5 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

Former Community Member

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

Former Community Member

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

Thanks,

Ankit