Other than using Session Attributes
is there a way to pass values from an Entity View
to Page View
when using DXA Java? This is with reference to DXA 1.x (actually 1.0 or pre-release version of DXA Java) and SDL Tridion 2013 SP1.
We have tried using cookies
and request scope attributes
for passing info from Entity View
to Page View
, but since everything is within the same request/response flow neither approach seemed to work.
To give a better picture, this is the use case:
I have a SDL DXA Page with its corresponding Controller
, EntityView
and PageView
. The purpose of this page is to receive a QueryString
parameter that identifies the type of image. Based on the type of image being requested, the Controller fetches a random image of this type from a pool of images managed in SDL.
The Entity View
gets the URL (and physical path) to the image file and it passes it to the Page View
. The Page View
then reads the image file from the file system and outputs a binary stream in response, effectively serving the image.
The URL of this page is used as the src
attribute of an Image used in an email template. So depending on the type of email (registration confirmation, reminder, thank you, etc.) a different image is loaded dynamically on request. Each time the same email is re-opened the user may see a different image (picked from the pool of same type of images).
Currently we are passing the image path
as a Session Attribute
from the Entity View
to the Page View
, however sometimes the Page View
is unable to get the Session Attribute
value resulting in an error and no image being returned.
So we are looking for an alternate way of passing the image URL from the Entity View
to the Page View
.
Session Attributes
is not working for you and what other way you are looking for and why? – Bart Koopman Sep 29 '17 at 7:54