Let's say I have a page that I hit at url Test.html which contains a single component on the page.
If this component, call it tableComp, contains a jsp named tableComp.jsp it correctly renders on the screen when Test.html is hit.
Currently I have a file in the same component directory that is called data.xml.jsp. I am able to hit Test.data.xml which calls the jsp file associated with data.xml. I am able to print to the screen my XML and it renders properly.
Now I want to display information to the screen as a JSON output when I hit a new file named data.json.jsp. I do the exact same process for the data.xml.jsp but I then get the following.
Invalid recursion selector value 'data' Cannot serve request to /content/{org}/desktop/en_US/{name}/Test.data.json in org.apache.sling.servlets.get.DefaultGetServlet Request Progress: 0 (2015-07-22 18:10:06) TIMER_START{Request Processing} 0 (2015-07-22 18:10:06) COMMENT timer_end format is {<elapsed msec>,<timer name>} <optional message> 0 (2015-07-22 18:10:06) LOG Method=GET, PathInfo=/content/{org}/desktop/en_US/{name}/Test.data.json
I have tried adding a Pages.json.jsp file to the /libs/foundation/components/primary/cq/Page section as suggested in another forum but this did not help. The content of this Pages.json.jsp file was <%@include file="proxy.jsp"%>.
How can I get JSON to work for this type of request?
Views
Replies
Total Likes
Can you check in SlingresourceResolver in osgi admin console for this url with data.json endpoint? Does it resolve to the component?
Views
Replies
Total Likes
Why would this value need to be supplied if calling something such as data.xml.jsp works out of the box?
Like I said before I am able to hit the page with Test.data.xml without changing anything else.
Views
Replies
Total Likes