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

Fetching values from request attributes

Avatar

Avatar
Validate 1
Level 2
v1101
Level 2

Likes

4 likes

Total Posts

138 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile

Avatar
Validate 1
Level 2
v1101
Level 2

Likes

4 likes

Total Posts

138 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back 10
View profile
v1101
Level 2

15-12-2020

Hi,

I am trying to set some value in request scope and fetch the same in HTL, it is not working, Not sure if this is doable in HTL without using Use API or backend changes.

product.jsp:

<%@include file="/libs/foundation/global.jsp" %>
<%
boolean isActive = false;
%>
<c:set var="productStatus" value="<%=isActive%>" scope="request" />

HTL:
<div data-sly-include="/apps/wknd/components/page/common/product.jsp" data-sly-unwrap></div>

<div>productStatus Flag - ${request.getAttribute("productStatus").toString}</div>

 

Thanks

View Entire Topic

Avatar

Avatar
Validate 10
MVP
kunal23
MVP

Likes

166 likes

Total Posts

565 posts

Correct Reply

172 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 50
View profile

Avatar
Validate 10
MVP
kunal23
MVP

Likes

166 likes

Total Posts

565 posts

Correct Reply

172 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 50
View profile
kunal23
MVP

15-12-2020

Yes you will have to write some backend code for getting request attributes. I would recommend that you write a generic backend class which can be used for fetching any request attribute. You can refer to following example - http://www.6dglobal.com/blog/accessing-request-variables-sightly-2015-01-23