Help Us Improve. Please let us know if you were asked any of these questions.

More Questions

ERROR - JSP / JSTL - javax.servlet.jsp.JspException: Type [java.lang.Integer] is not valid for option items

Error

javax.servlet.jsp.JspException: Type [java.lang.Integer] is not valid for option items at org.springframework.web.servlet.tags.form.OptionWriter.writeOptions(OptionWriter.java:143) at org.springframework.web.servlet.tags.form.OptionsTag.writeTagContent(OptionsTag.java:155) at org.springframework.web.servlet.tags.form.AbstractFormTag.doStartTagInternal(AbstractFormTag.java:84) at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:80) at

Sample Code
<form:options items="${command.getQuantity()}" itemValue="" itemLabel="" />

where getQuantity returns an Integer value.

Cause


items should hold collection of objects and Integer Type is not permitted.

Resolution


Have a method that returns collection of quantities.

<form:options items="${command.getCollectionOfQuantities()}" itemValue="" itemLabel="" />


 Stay Updated with Java Posts directly to your mailbox.
Enter your email address:

'
Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner
comments powered by Disqus




×

Try our new Java Interview Questions Search Tool.

There are more than 1000 questions with practice tests.

It's updated daily and It's Awesome.


×

Try our new Java Practice Test tool.

There are more than 200 questions and expanding quickly. It's updated daily and It's Awesome.