We are migrating our application from spring 3 to spring 4. I now have a problem wherein the session variables gets resolved when I use c:out and not when I use form:form. I viewed a similar issue on another post which remained unanswered. But, I am now facing the same issue.
<%@ include file="/common/taglibs.jsp"%>
<c:forEach var="item" items="${yesNos}">
<c:out value="${item}"/>
</c:forEach>
<form:select path="blocked">
<form:option value="" label=""/>
<form:options items="${yesNos}" itemValue="id" itemLabel="${domainValueProperty}"/>
</form:select>
c:forEach is able to iterate on the list "yesNos". form:options cannot seem to identify this list "yesNos" and throws an error
OptionsTag - Type [java.lang.String] is not valid for option items
yesNos is a list of our POJO and has a corresponding PropertyEditor defined. I suspected PropertyEditor to be an issue but the below realization stumped me.
I also realized the form:form tag also shows an issue wherein the dynamic session variable passed to the action attribute does not get resolved and stays as ${} even on the generated HTML source.
JSP: formActionURL is of type String
<form:form action="${formActionURL}" commandName="pDSearch">
HTML source
<form id="pDSearch" action="${formActionURL}" method="post">
- I have the taglibs uri configured and it works well, since the tags are being processed.
- This worked with Spring 3.0.7 & servlet 2.3. Now, we are migrating to spring 4.0.6 & servlet 2.3.
- On the other post, the requester used servlet 2.5 and still faced the issue. Migrating to servlet 2.5 would be a huge impact on our application.
Below is the taglibs.jsp that is imported on the page
<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8" contentType="text/html; charset=utf-8" %>
<%@ taglib uri="http://www.springframework.org/security/tags" prefix="security" %>
<%@ taglib uri="http://www.springmodules.org/tags/commons-validator" prefix="v" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display" %>
<%@ taglib uri="http://struts-menu.sf.net/tag-el" prefix="menu" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.opensymphony.com/oscache" prefix="cache" %>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator"%>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="page"%>
Greatly appreciate if someone could redirect me to a source where I can find answer to my issue. Do let me know if you need further information.