Confusion about JSP and HTML pages

Avatar

Avatar

LinearGradient

Avatar

LinearGradient

LinearGradient

15-10-2015

Hi,

I find myself confused every now and then regarding HTML pages, JSP pages, etc. in CQ5. I guess I have to re-read the Sling docs again.

But basically, at the moment, under our app folder (e.g. /apps/foo) we have a bunch of .html pages that are requested by our Angular JS app via AJAX.

I want to add some dynamic code to these pages (e.g. JSP scriptlets, etc.)

What is the proper way of doing this in CQ 5?

Thanks.

View Entire Topic

Avatar

Avatar

gabriel_walt

Employee

Avatar

gabriel_walt

Employee

gabriel_walt
Employee

15-10-2015

I'd advise you to go with Sightly instead of JSP for any new project as it is designed to replace JSP. This will give you automatic proper HTML encoding and cross-site scripting protection built-in. It will also force some healthy separation of concerns, preventing the kind of code & markup mix you typically can end-up with in JSPs. Thus making the markup overall more readable.