Expand my Community achievements bar.

SOLVED

Converting Jsp to HTL

Avatar

Level 3

Hi,

I need to convert my jsp page to HTL(Sightly).

In Jsp we use ,

<jsp:useBean id="aa" scope="page"

class="com.aaa.bbb.cq.ccc.dd.MyJavaClass" />

<jsp:setProperty name="aa" property="slingRequest"

value="${slingRequest}" />

Where  it will call the java class named 'MyJavaClass' on page load.

In HTL(Sighlty) how we can implement this on page load,can anyone guide me ?

Thanks,

Nandhini

1 Accepted Solution

Avatar

Correct answer by
Employee

You can use data-sly-use to use Java-classes.

View solution in original post

3 Replies

Avatar

Correct answer by
Employee

You can use data-sly-use to use Java-classes.

Avatar

Community Advisor

You can create a model for your component and fetch the properties in the Sling Model if you need to manipulate with those.

A sample to help you Creating a site footer in AEM 6 using Sightly and Sling Models | 6D Labs