Calling USE API script from JSP

Avatar

Avatar
Validate 1
Level 1
PremIB
Level 1

Likes

0 likes

Total Posts

9 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
PremIB
Level 1

Likes

0 likes

Total Posts

9 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
PremIB
Level 1

19-07-2021

What is the alternative for the data-sly-use attribute in JSP. Is there any other way to call use api scripts from a .jsp file?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Seeker
MVP
Suraj_Kamdi
MVP

Likes

148 likes

Total Posts

164 posts

Correct reply

42 solutions
Top badges earned
Seeker
Bedrock
Engage 1
Springboard
Validate 1
View profile

Avatar
Seeker
MVP
Suraj_Kamdi
MVP

Likes

148 likes

Total Posts

164 posts

Correct reply

42 solutions
Top badges earned
Seeker
Bedrock
Engage 1
Springboard
Validate 1
View profile
Suraj_Kamdi
MVP

19-07-2021

@PremIB As per my knowledge you need to write the whole logic into the JSP file itself and inside the scriptlet tags.

ex.

 

<%

String propertyName = properties.get("propertyName", String.class);

%>

 

P.S.  It better to use Sightly /HTL based component over JSP based component.

 

Answers (1)

Answers (1)

Avatar

Avatar
Boost 100
Level 6
snbaem
Level 6

Likes

115 likes

Total Posts

246 posts

Correct reply

37 solutions
Top badges earned
Boost 100
Springboard
Establish
Validate 25
Validate 10
View profile

Avatar
Boost 100
Level 6
snbaem
Level 6

Likes

115 likes

Total Posts

246 posts

Correct reply

37 solutions
Top badges earned
Boost 100
Springboard
Establish
Validate 25
Validate 10
View profile
snbaem
Level 6

19-07-2021

Hi,

 

What is the use case here? Please see https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/calling-custom-utility-met... if that is useful.

Ideally if you have backend implementation already as a Model try to use HTL. Keep the backend implementation logic in service components so that if you have to use jsp, it can be called within jsp.

Another way (may be not ideal) use a .html file to use the data-sly-use attribute. Use or include this HTL file within the ultimate jsp where you are looking to use the data-sly-use attribute