Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

What is the approach to pull data from the java class using $ajax call

Avatar

Avatar
Boost 1
Level 1
oscarr38307878
Level 1

Like

1 like

Total Posts

13 posts

Correct Reply

1 solution
Top badges earned
Boost 1
Affirm 1
View profile

Avatar
Boost 1
Level 1
oscarr38307878
Level 1

Like

1 like

Total Posts

13 posts

Correct Reply

1 solution
Top badges earned
Boost 1
Affirm 1
View profile
oscarr38307878
Level 1

05-01-2021

This may not be exclusively for AEM, but I would like to know what is the best approach considering the framework.

I’m creating an Infinitescroll solution in a JSP file

I have a java class that uses query builder to load content into a jsp page. The class will load a content list based on a search filter.

The solutions I found are:

By creating a servlet, which I think it will require to refactor the whole business logic.

By creating JSONObject and pull from it.

By Calling the existing method (Which I favor since this is already loading into the page)

 

Thanks for all your assistance in advance…

 

AEM 6.3.3.8

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
Veena_Vikram
MVP

Likes

471 likes

Total Posts

1,039 posts

Correct Reply

121 solutions
Top badges earned
Establish
Coach
Contributor 2
Seeker
Ignite 5
View profile

Avatar
Establish
MVP
Veena_Vikram
MVP

Likes

471 likes

Total Posts

1,039 posts

Correct Reply

121 solutions
Top badges earned
Establish
Coach
Contributor 2
Seeker
Ignite 5
View profile
Veena_Vikram
MVP

05-01-2021

@oscarr38307878 What is the version of AEM you are using ? Just wondering why you are still using JSPs.

 

From my experience , to fetch data via Ajax call from Jquery , I normally write a servlet and invoke a call to the same via ajax.

 

Happy New Year 

Veena ✌

Answers (1)

Answers (1)

Avatar

Avatar
Springboard
Level 6
snbaem
Level 6

Likes

92 likes

Total Posts

217 posts

Correct Reply

29 solutions
Top badges earned
Springboard
Establish
Validate 25
Validate 10
Validate 1
View profile

Avatar
Springboard
Level 6
snbaem
Level 6

Likes

92 likes

Total Posts

217 posts

Correct Reply

29 solutions
Top badges earned
Springboard
Establish
Validate 25
Validate 10
Validate 1
View profile
snbaem
Level 6

05-01-2021

Hi,

At the moment I can think of  - Making an ajax call to servlet and doing the query over there (use service)  and returning json object to populate the results through js. Each call will only get a set of results. On scroll the call is made again.

The logic for query will be same as you would be doing already. Also suggest to use Sightly.