What's the recommended way to let a JSP file be accessed with .html extension? | Community
Skip to main content
LinearGradient
Level 6
October 16, 2015
Solved

What's the recommended way to let a JSP file be accessed with .html extension?

  • October 16, 2015
  • 1 reply
  • 683 views

Hi,

  1. What's the recommended way to implement pages that are shared deployment-wide? For example when we want to implement a page called "Under review" that based on some rules should be served to users in place of the actual pages of a website.
  2. We have a few JSP under /content/global-pages that we want to be accessible with .html extension. For example, there's a file /content/global-pages/under-review.jsp that should be accessible as www.foo.com/under-review.html. What's the recommended way to configure CQ 5 to perform this?

Thanks.

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 joerghoh

in CQ/AEM pages are resources, which have a resource type. Based on this resourcetype the correct rendering logic (in many cases a JSP) is called to render this resource. So you never call a JSP directly.

To 1: You could implement a servlet filter, which checks for the "under review" conditions and then  does a redirect to your "under review" page.

To 2: As said, you cannot address JSPs directly. Create pages in /content, which have the proper resource type. And then put your JSPs below /apps. Basically create dedicated templates and components for this case.

 

Jörg

1 reply

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

in CQ/AEM pages are resources, which have a resource type. Based on this resourcetype the correct rendering logic (in many cases a JSP) is called to render this resource. So you never call a JSP directly.

To 1: You could implement a servlet filter, which checks for the "under review" conditions and then  does a redirect to your "under review" page.

To 2: As said, you cannot address JSPs directly. Create pages in /content, which have the proper resource type. And then put your JSPs below /apps. Basically create dedicated templates and components for this case.

 

Jörg