Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

Request object inside experience fragment

Avatar

Level 6

Hi Team,

 

We have one experience fragment  in experience fragment we have   one component.

component is working fine but when we tried to inject the request object and to get the browser URL inside @postconstruct method we are not able to get the request inside the post construct method.

 

any one faces this issue any time 

if any solution inside Experience Fragment  to get the request object.

 

@Model(adaptables = {SlingHttpServletRequest.class, Resource.class}, defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL)
public class LinkItem {
@Self
private SlingHttpServletRequest request;
@PostConstruct
private void activate(){

String url=request.getRequestURI();
 
 
1 Reply

Avatar

Community Advisor

Hi,

It should work.

Can you check this component with minimum changes?

Arun Patidar

AEM LinksLinkedIn