Announcement Announcement Module
Collapse
No announcement yet.
Help Me This Error In Spring ''items' must not be null' Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help Me This Error In Spring ''items' must not be null'

    Dear all,

    I am beginner for Spring, I have a Demo. But it happens with this errors:

    org.apache.jasper.JasperException: java.lang.IllegalArgumentException: 'items' must not be null
    org.apache.jasper.servlet.JspServletWrapper.handle JspException(JspServletWrapper.java:534)
    org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:457)
    org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:333)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:722)
    org.springframework.web.servlet.view.InternalResou rceView.renderMergedOutputModel(InternalResourceVi ew.java:239)
    org.springframework.web.servlet.view.AbstractView. render(AbstractView.java:250)
    org.springframework.web.servlet.DispatcherServlet. render(DispatcherServlet.java:1060)
    org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:798)
    org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:716)
    org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:647)
    org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:552)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:722)

    http://www.vaannila.com/spring/spring-form-tags-1.html
    This link for my Demo

    Plz, help me!!!


    I will send you my demo!!!

  • #2
    null lists referred by items property of form:options tag might be the reason

    Hi memberhieu,

    I hope you must have already overcome this issue but still wanted to post something to help others.

    This error comes when we have a <form:options /> tag(or any other tag which takes list as property) on our view(jsp) and the items attribute is referring to a list which is null.

    for example:

    Code:
    <form:select path="country" >
         <form:options items="${countryList}" />
    </form:select>
    in the above case countryList is a simple list containing string objects having country names and to avoid error a not null list should be set in any scope with the name "counrtyList".

    It can be set in request scope i.e. can be added to ModelAndView object returned by controller (most common place).

    Comment


    • #3
      Hi Devesh,

      I am very happy to receive your replies.
      I will try to do it.

      Once again
      Thank you so much.

      Comment

      Working...
      X