0

I am working on migrating a dynamic web project from Spring 3.0.6 to 3.2.3. Prior to this migration, we had no issue with our dropdowns. However, after migrating, we get the following error:

Exception created : com.ibm.websphere.servlet.error.ServletErrorReport: javax.servlet.jsp.JspException: Type [java.lang.String] is not valid for option items

I've removed all the code to isolate the issue, so below is the relevant code. Please let me know if any further information is needed. The thing that puzzles me is that the List isn't even String based. I realize that the JSP will treat the values as String for the options, but my understanding is that there is a built-in PropertyEditor that would do this translation.

Controller:

@RequestMapping("/reports-menu.html")
public String showReportsHome(@ModelAttribute("reportForm")ReportForm reportForm, Model model, HttpSession session, HttpServletResponse response, HttpServletRequest request) {

    List<Integer> intList = new ArrayList<Integer>();
    intList.add(1);
    intList.add(2);
    intList.add(3);

    model.addAttribute("intList", intList);


    return "reports-home-int";
}

JSP:

<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<%@ taglib uri="/WEB-INF/tld/sbp.tld" prefix="sbp" %>

<form:form name="report_form" method="POST" modelAttribute="reportForm" action="reports-menu.html" id="report_form">
<form:hidden path="download" id="form_download"/>
<form:hidden path="sortDirection" />
<form:hidden path="sortBy"/>
<input type="hidden" name="reset"/>
<div align="left">
<table border="0">
<tr>
<td><b>Mailer Name</b></td>
<td>
<form:select path="mailerCond">
<form:options items="${intList}" />
</form:select>
</td>               
</tr>
</table>
</div>
</form:form>
Thomas Lanham
  • 21
  • 1
  • 3
  • Looks like if the JSTL `${intList}` isn't processed anymore. Make sure that you are only upgrading Spring and that you include a proper JSTL library and that your web.xml has the proper version (at least 2.5 I would say). I suggest using the normal taglibs discovery mechanism instead of putting your own copy in the `/WEB-INF/dtd` directory as you do now. – M. Deinum Sep 11 '14 at 06:18
  • I verified the JSTL library is 1.2 and the web.xml is set to version 2.5. If I use the "c" tags, it iterates through without an issue. I might workaround this by simply using the "c" tag to populate the information, but I would ultimately like to figure out where the disconnect is occurring when we migrate our other projects. – Thomas Lanham Sep 11 '14 at 11:52
  • Something is disabling the EL parsing. Is there a reason why you include the `c.tld` and `fmt.tld` in the WEB-INF.? They are automatically detected in the `standard.jar` if that is included due to the TLD discovery mechanism. – M. Deinum Sep 11 '14 at 11:57
  • From my understanding, standard.jar is not required for JSTL 1.2. However, just to rule that out, I did download the jar and changed the include to use the discovery mechanism, but the end result was the same. – Thomas Lanham Sep 11 '14 at 13:03
  • You need to have at least a JSTL implementation however that isn't related to the EL not parsing. In general that is related to a wrong web.xml. Could you post your web.xml (header)... Also the jsp doesn't seem a full page... Do you use includes by any chance? – M. Deinum Sep 11 '14 at 13:30
  • Sorry for the delayed response. The page was stripped of everything to isolate the problem issue. The project to migrate has been delayed, so I will have to revisit this when it's approved again. I'm wondering if I would end up having to upgrade other components as well (Tiles, etc.) for this to end up working. Thanks for your assistance in trying to troubleshoot this. – Thomas Lanham Sep 16 '14 at 15:30

0 Answers0