Leiste mit Community-Erfolgen erweitern.

Mark Solution

Diese Konversation wurde aufgrund von Inaktivität geschlossen. Bitte erstellen Sie einen neuen Post.

GELÖST

How to create Thumbnail Servlet in AEM

Avatar

Level 4
 
1 Akzeptierte Lösung

Avatar

Korrekte Antwort von
Employee Advisor

Check the component which is rendering/calling this image. Also, check JS if needed. It's your code, so you should be able to better drill it down.

Lösung in ursprünglichem Beitrag anzeigen

8 Antworten

Avatar

Community Advisor and Adobe Champion

Hi @vinuu123 ,

 

Do you want to add more details on what you want to achieve in that servlet?

 

Thanks,

Ritesh Mittal

Avatar

Level 4

*WARN* -  GET /content/project/us/en/about-us/events/shows/ampp-1010.thumb.600.600.png HTTP/1.1] com.day.cq.wcm.core.impl.servlets.ThumbnailServlet Cannot create thumbnail 2java.lang.NullPointerException: null

 

this is the error/warning I am getting

I want to create custom servlet to avoid this warn, by adding default thumbnail

Avatar

Employee Advisor

You should debug, from where this image request is generated and fix the code, instead of writing custom servlet to handle this error.

Avatar

Level 4

How can I debug that ?

Avatar

Korrekte Antwort von
Employee Advisor

Check the component which is rendering/calling this image. Also, check JS if needed. It's your code, so you should be able to better drill it down.

Avatar

Level 4

Thankyou so much @Mohit_KBansal 

Avatar

Level 4

@Mohit_KBansal I want scenario like, if thumbnail is authored it is showing that original thumbnail in the page, if not authored I want default thumbnail.

Avatar

Employee Advisor

If you are using custom model, set you imgSrc field value like

If imgSrc configured in the component
    set imgsrc=component's imgSrc
Else
    set imgsrc=DEFAULT_IMG_PATH

 

In your HTL, just use imgSrc

<img src="myObj.imgSrc">