I use Spring Web Flow (v. 1.0.5), and I have a JSP page that makes an AJAX call to a stream and needs to read the XML results. This thread successfully sets up the object in FlowScope and then calls up the JSP page to display the results. On a JSP page, I would like to check if an object has a property (say .firstName), and if so, do something. I can access the variable in FlowScope using the JSTL expression language (saying $ {userObj}), but that just lets me spit it out. I tried the methods below to figure this out and use the logic around this with varying degrees of success.
Update: The question remains: how to get the context and flow area in the script section (<%%>)?
<rootnode>
<c:if test="${!empty(userObj.firstName)}">
<test>not empty</test>
</c:if>
<%
/* Attempt 2: This throws an error, can't resolve "context". How do I get the context? */
if (context.getFlowScope().userObj != null) {
out.write("not null");
} else {
out.write("not not null");
}
%>
<userReference>${userObj}</userReference>
<userReference_firstName>${userObj.firstName}</userReference_firstName>
</rootnode>