Yeah got it, thanks for that. I've managed to get it running whilst
populating from a db so I'm getting there. Thanks a lot guys. 


Kevin Galligan-2 wrote:
> 
> Nice catch.  There's no "new ArrayList()".
> 
> Mark, try finding the log with a NullPointerException in it related to
> this.  In the future, look in that log to find the root exception.
> 
> On 8/21/06, Appachi, Kannan <[EMAIL PROTECTED]> wrote:
>>
>>  Is it because countryList is missing object initialization.I did not
>> find
>> a place where its initialized..
>>
>>
>>
>>  ------------------------------
>> *From:* Kevin Galligan [mailto:[EMAIL PROTECTED]
>> *Sent:* Monday, August 21, 2006 3:27 PM
>> *To:* MyFaces Discussion
>> *Subject:* Re: Newbie Question
>>
>> If you dig around in the logs, there's generally the root exception that
>> caused the issue.  Try looking around for that.  Otherwise we're flying
>> blind.
>>
>> I'd also suggest posting what '#{country.selectedCountry}' points to. 
>> Its
>> not in the class.  If this doesn't exist, its possible that JSF is
>> getting
>> upset because it wants to convert the type of the SelectItem, but doesn't
>> really have a target type, so it fails or whatever.
>>
>> Regardless you need that value available.
>>
>> On 8/21/06, tukutela <[EMAIL PROTECTED]> wrote:
>> >
>> >
>> > Sorry all, the bean.list was mean to be an example, typing too quickly.
>> >
>> > Here's the error from console.
>> > 21-Aug-2006 3:16:04 PM
>> org.apache.catalina.core.StandardWrapperValveinvoke
>> > SEVERE: Servlet.service() for servlet Faces Servlet threw exception
>> > javax.faces.FacesException: Cannot get value for expression
>> > '#{country.countryList }'
>> >         at
>> > org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(
>> > ServletExternalContextImpl.java:421)
>> >         at
>> > org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(
>> > JspViewHandlerImpl.java :234)
>> >         at
>> > org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java
>> > :352)
>> >         at javax.faces.webapp.FacesServlet.service(FacesServlet.java
>> > :107)
>> >         at
>> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (
>> > ApplicationFilterChain.java:252)
>> >         at
>> > org.apache.catalina.core.ApplicationFilterChain.doFilter(
>> > ApplicationFilterChain.java:173)
>> >         at
>> > org.apache.catalina.core.StandardWrapperValve.invoke(
>> > StandardWrapperValve.java :213)
>> >         at
>> > org.apache.catalina.core.StandardContextValve.invoke(
>> > StandardContextValve.java:178)
>> >         at
>> > org.apache.catalina.authenticator.AuthenticatorBase.invoke(
>> > AuthenticatorBase.java:524)
>> >         at
>> >
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
>> > :126)
>> >         at
>> >
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
>> > :105)
>> >         at
>> > org.apache.catalina.core.StandardEngineValve.invoke (
>> > StandardEngineValve.java:107)
>> >         at
>> > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
>> > :148)
>> >         at
>> > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
>> > :869)
>> >         at
>> >
>> >
>> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
>> > (Http11BaseProtocol.java:664)
>> >         at
>> > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
>> > PoolTcpEndpoint.java:527)
>> >         at
>> > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
>> > LeaderFollowerWorkerThread.java:80)
>> >         at
>> > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
>> > ThreadPool.java:684)
>> >         at java.lang.Thread.run(Thread.java:595)
>> >
>> >
>> > Kevin Galligan-2 wrote:
>> > >
>> > > Where's the accessor for 'country.selectedCountry'?
>> > >
>> > > Also, please post the actual error.  After running the thing, look in
>> > > tomcat's 'logs' directory, probably the localhost.[date].log file.
>> > >
>> > > On 8/21/06, tukutela <[EMAIL PROTECTED]> wrote:
>> > >>
>> > >>
>> > >> Hi all,
>> > >>
>> > >> I'm just starting out with Java/JSF having come from a .net c#
>> > >> background.
>> > >> I'm having some trouble in starting out with JSF and I was hoping
>> > that
>> > >> someone can point me in the right direction, this error is driving
>> me
>> >
>> > >> nuts!!!
>> > >>
>> > >> I'm using MyEclipse and the server is Apache2, Tomcat5.5, and
>> MyFaces
>> > >> 1.1.1.
>> > >> I'm trying to fill a selectOneMenu list using a backend bean and are
>> > >> getting
>> > >> an error that says that the server cannot get value from expression
>> > >> #{bean.list}
>> > >>
>> > >> Here's the JSP code
>> > >> <h:selectOneMenu id="countryListItems" styleClass="lists"
>> > >> value="#{country.selectedCountry}">
>> > >>                                 <f:selectItems value="#{
>> > >> country.countryList}" />
>> > >> </h:selectOneMenu>
>> > >>
>> > >> Here's the Bean
>> > >>
>> > >> package com.blah.mgr;
>> > >>
>> > >> public class Country {
>> > >>
>> > >>         private ArrayList<SelectItem> countryList; //variable array
>> > list
>> > >> to display
>> > >> set to countries.
>> > >>
>> > >>         // Constructor, initializes class variables, sets up
>> > connection
>> > >> with
>> > >> database.
>> > >>         public Country()
>> > >>         {
>> > >>                 buildList();
>> > >>         }
>> > >>
>> > >>         // Returns the arrayList, ensure that the constructor reads
>> > the
>> > >> database
>> > >> first.
>> > >>         public ArrayList getCountryList()
>> > >>         {
>> > >>                 return this.countryList;
>> > >>         }
>> > >>
>> > >>         // Sets the country List (not really required but in here
>> > anyway.
>> > >>         public void setCountryList(ArrayList<SelectItem>
>> CountryList)
>> > >>         {
>> > >>                 this.countryList = CountryList;
>> > >>         }
>> > >>
>> > >>         private void buildList()
>> > >>         {
>> > >>                 countryList.add(new SelectItem("Canada", "Canada"));
>> > >>                 countryList.add(new SelectItem("US", "US"));
>> > >>         }
>> > >> }
>> > >>
>> > >> Here's the link in faces-config.xml:
>> > >>   <managed-bean>
>> > >>         <managed-bean-name>country</managed-bean-name>
>> > >> <managed-bean-class> com.blah.mgr.Country</managed-bean-class>
>> > >>         <managed-bean-scope>session</managed-bean-scope>
>> > >>   </managed-bean>
>> > >>
>> > >> I'm sure the solution is simple but I've found it difficult to get
>> > good
>> > >> documentation, might be where I'm looking (or not looking) but I'm
>> > still
>> > >> getting lost. Any help is greatly appreciated, thanks in advance.
>> > >> --
>> > >> View this message in context:
>> > >> http://www.nabble.com/Newbie-Question-tf2141924.html#a5912338
>> > >> Sent from the MyFaces - Users forum at Nabble.com.
>> > >>
>> > >>
>> > >
>> > >
>> >
>> > --
>> > View this message in context:
>> http://www.nabble.com/Newbie-Question-tf2141924.html#a5913047
>> >
>> > Sent from the MyFaces - Users forum at Nabble.com.
>> >
>> >
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Newbie-Question-tf2141924.html#a5926534
Sent from the MyFaces - Users forum at Nabble.com.

Reply via email to