Approach to convert jsp code to htl in aem

Avatar

Avatar

srikanthg212933

Avatar

srikanthg212933

srikanthg212933

10-09-2020

Hi 

I have a usecase where currently we have two components with below code structure dependency

 

componenta

  •      show.jsp
  • sling:resourcesupertype : componentb

Componentb

  • init.jsp
  • componentb.jsp -----> inside this show.jsp is called.
  • show.jsp

So currently I wanted to convert componenta show.jsp to html(htl) with model class without effecting supertype componentb(because this component is used in multiple places dint want to disturb this). How this can be achieved i mean how can make sure my html is loaded once the request comes to show.jsp in componenta. any references would be helpful.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

3.1K

Likes

1.2K

Correct Reply

883

Avatar

Arun_Patidar

MVP

Total Posts

3.1K

Likes

1.2K

Correct Reply

883
Arun_Patidar
MVP

13-09-2020

Hi,

I think, you can do it without any issue.

Convert componentA into HTL(HTML+Model)

Include ComlponnetA into ComponentB using cq:include or sling:include

Answers (1)

Answers (1)

Avatar

Avatar

Veena_Vikram

MVP

Avatar

Veena_Vikram

MVP

Veena_Vikram
MVP

10-09-2020

@srikanthg212933 My genuine opinion is not to mix up HTL and JSP. You might be able to do it, but I don't think it is the best way to do it. 

 

Thanks

Veena ✌