Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How to create Thumbnail Servlet in AEM

Avatar

Level 4
 
1 Accepted Solution

Avatar

Correct answer by
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.

View solution in original post

8 Replies

Avatar

Community Advisor

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

Correct answer by
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

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