Hi,
Make sure that the arraylist property or its
contents are not null. It must be initialised before
the setter method gets invoked for this.
regards...
Arvind
--- "Fraley, Taylor" <[EMAIL PROTECTED]> wrote:
> So I'm having a very strange problem. I have a jsp
> that's using a
> h:selectOneMenu populated by an ArrayList within a
> bean, which is all
> pretty standard. In one environment, on my desktop
> PC running Tomcat
> 5.5, everything works fine. On my SPARC running the
> same version of
> Tomcat, configured, from what I can tell,
> identically, I get the
> following exception when loading the page:
>
> org.apache.jasper.JasperException:
> org.apache.jasper.JasperException:
> javax.servlet.jsp.JspException: "{2}" Conversion
> Error setting value
> ''{0}'' for ''{1}''.
>
>
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServle
> tWrapper.java:512)
>
>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
> va:377)
>
>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
>
>
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
>
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>
>
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFil
> ter.java:144)
>
> I've done some poking around on Google, but haven't
> found anything
> terribly useful. The two possible explanations I've
> found (getter for
> the ArrayList returning null and a mistype of the
> managed bean name in
> the jsp vs. the faces-config.xml) both don't seem to
> apply here. Here
> are the relevant snippets of code:
>
> ...from faces-config.xml...
>
> <managed-bean>
>
>
<managed-bean-name>TransactionReportBean</managed-bean-name>
>
>
<managed-bean-class>com.level3.ssid.idd.report.web.TransactionReportBean
> </managed-bean-class>
> <managed-bean-scope>session</managed-bean-scope>
> </managed-bean>
>
> ...from the TransactionReportBean...
>
> public TransactionReportBean()
> {
> availableTimes.add(new SelectItem("0", "12:00
> AM"));
> availableTimes.add(new SelectItem("1", "01:00
> AM"));
> availableTimes.add(new SelectItem("2", "02:00
> AM"));
> availableTimes.add(new SelectItem("3", "03:00
> AM"));
> availableTimes.add(new SelectItem("4", "04:00
> AM"));
> availableTimes.add(new SelectItem("5", "05:00
> AM"));
> availableTimes.add(new SelectItem("6", "06:00
> AM"));
> availableTimes.add(new SelectItem("7", "07:00
> AM"));
> availableTimes.add(new SelectItem("8", "08:00
> AM"));
> availableTimes.add(new SelectItem("9", "09:00
> AM"));
> availableTimes.add(new SelectItem("10", "10:00
> AM"));
> availableTimes.add(new SelectItem("11", "11:00
> AM"));
> availableTimes.add(new SelectItem("12", "12:00
> PM"));
> availableTimes.add(new SelectItem("13", "01:00
> PM"));
> availableTimes.add(new SelectItem("14", "02:00
> PM"));
> availableTimes.add(new SelectItem("15", "03:00
> PM"));
> availableTimes.add(new SelectItem("16", "04:00
> PM"));
> availableTimes.add(new SelectItem("17", "05:00
> PM"));
> availableTimes.add(new SelectItem("18", "06:00
> PM"));
> availableTimes.add(new SelectItem("19", "07:00
> PM"));
> availableTimes.add(new SelectItem("20", "08:00
> PM"));
> availableTimes.add(new SelectItem("21", "09:00
> PM"));
> availableTimes.add(new SelectItem("22", "10:00
> PM"));
> availableTimes.add(new SelectItem("23", "11:00
> PM"));
> }
>
> public ArrayList<SelectItem>
> getAvailableCnamOptions()
> {
> return availableCnamOptions;
> }
>
> ...from the jsp...
>
> <h:selectOneMenu id="beginHour"
> value="#{TransactionReportBean.beginHour}"
> styleClass="rptSmallInputs">
> <f:selectItems
> value="#{TransactionReportBean.availableTimes}"/>
>
> </h:selectOneMenu>
>
> Judging by all the hits on Google, it seems to be a
> pretty common
> problem, but I'm sort of stumped on what to do next
> to figure out the
> problem. Has anyone seen this? Any pointers?
>
> Thanks,
> Taylor
>
>
>
__________________________________________________________
Yahoo! India Answers: Share what you know. Learn something new
http://in.answers.yahoo.com/