Search code examples
spring-webflow

SpringWebflow: Setting values in RequestContext -> httpServletRequest is not accessible at JSP


I am setting some values in request in my action/controller class like this:

HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getNativeRequest();
request.setAttribute("testKey", "testValue");

But when I tried to retrieve this from JSP, I am getting null value.

<%
String testKey = ""+request.getAttribute("testKey");
%>

Any idea, please help.


Solution

  • After research I found 2 ways to do this: 1) Using a same modelAttribute in and assign values back and forth 2) setting values into context.getFlowScope().put(KEY,OBJECT); And retrieving this value (OBJECT) from JSP using ${KEY}.