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

Enabling Sling Dynamic Include (SDI) with Edge Side Includes (ESI) result to a null request.getParameter value from model

Avatar

Level 2

Whenever I enable SDI in our configMgr, getting the values from request.getParameter() from the model result to a blank value.

 

The URL will be like https://www.test.com/app/replacement?searchstring=test

And the component called that is included in another .html page on the same directory:

<section data-sly-test="${'large' == properties.sizeVersion}" class="">
	<div class="">
		<sly data-sly-include="result.html"></sly>
	</div>
</section>

Then result.html

<sly data-sly-use.repl="com.xxx.xxx.use.ReplacementResult"></sly>

<sly data-sly-test="${repl.dataExist}">
<header class="b-deck__header">
    <h3 class="">Header</h3>
</header>
</sly>

The result.html is being called, as well as the ReplacementResult model by debugging it. No errors. The searchstring becomes null/blank

searchstring = request.getParameter("searchstring");

I even tried removing the result.html, and just pasted it in the parent.html, still not able to get any param values from searchstring

 

Here is my config

pvancajas_0-1671458938180.png

 

Are there any config changes needed here?

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 2

So, me and my colleagues have looked at this. And it seems like the approach I presented will not work at this point.

So, we may need to do / think of another way such as doing a servlet approach, but it can do a lot of changes in our code. So now, we may need to disable SDI as of the moment.

Thank you and I will close this one for now, maybe in the future this will be fixed.

View solution in original post

5 Replies

Avatar

Level 2

Hi @arunpatidar , thank you for your reply!

Though, would you be so kind and direct me what part in your link I should check to be able to discover any fix for my problem? 

Thank you!

Avatar

Community Advisor

can you check the request logs, what you are getting as a request when you enable SDI?

When you enable the SDI, you get the additional request for that component, which will not be adding any parameters and thats why you will be getting null. This is expected.

You can see it from request.log.



Arun Patidar

Avatar

Level 2

Hi @arunpatidar ,

I checked the logs and I see the URL

pvancajas_0-1671536085767.png

Talking to a colleague, it seems that getParameter seems to be not working when SDI is enabled.

Anyways, thanks. It seems like this is a limitation of SDI that is either needed to be fixed, or we just have to make our components work with SDI limitation

Thank you

Avatar

Correct answer by
Level 2

So, me and my colleagues have looked at this. And it seems like the approach I presented will not work at this point.

So, we may need to do / think of another way such as doing a servlet approach, but it can do a lot of changes in our code. So now, we may need to disable SDI as of the moment.

Thank you and I will close this one for now, maybe in the future this will be fixed.