Help Us Improve. Please let us know if you were asked any question in your interview.

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 in your email.

Enter your email address:


Delivered by FeedBurner
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




×

Would like to 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.


×

Would like to try our new Java Practice Test tool.

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