Expand my Community achievements bar.

SOLVED

Approach to convert jsp code to htl in aem

Avatar

Level 3

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.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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



Arun Patidar

View solution in original post

2 Replies

Avatar

Community Advisor

@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 ✌

Avatar

Correct answer by
Community Advisor

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



Arun Patidar