Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: FAILED TO OBTAIN COLLECTION

  1. #1
    Junior Member
    Join Date
    Dec 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default FAILED TO OBTAIN COLLECTION

    I was developing a standalone application under struts 1.x framework.
    I need to do create dropdowns in jsp using struts tags.I have created using <options:collection>tag and created getters and setters for the property in form also.But the dropdown was not getting populated with all data.only some data was getting populated at last it showing an servlet exception :Failed to obtain collection in the dropdown.Can anyone please look into my issue....

    --- Update ---

    Experts,please look into my issue.I need to solve this as soon as possible Thanks in advance


  2. #2
    Member andbin's Avatar
    Join Date
    Dec 2013
    Location
    Italy
    Posts
    443
    Thanks
    4
    Thanked 122 Times in 114 Posts

    Default Re: FAILED TO OBTAIN COLLECTION

    Please, post some code. It's impossible to answer with these few infos.
    Andrea, www.andbin.netSCJP 5 (91%) – SCWCD 5 (94%)

    Useful links for Java beginnersMy new project Java Examples on Google Code

  3. #3
    Junior Member
    Join Date
    Dec 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: FAILED TO OBTAIN COLLECTION

    This is the jsp code...


    <html:select property="market" name="createcountryform" title="Please select Country" onchange="PopulateStatezone();">
    <htmlption value="">Select One</htmlption>
    <htmlptionsCollection name="createcountryform" property="countryList" value="countryCode" label="countryName" />
    </html:select>



    Form---
    public class CreateCountryForm{

    private List<CountryInfoDTO> countryList = null;

    /**
    * @return Returns the countryList.
    */
    public List<CountryDTO> getCountryList() {
    return countryList;



    /**
    * @param countryList
    * The countryList to set.
    */
    public void setCountryList(List<CountryDTO> countryList) {
    this.countryList = countryList;
    }
    }





    DTO---

    public class CountryDTO{

    private String countryCode = null;
    private String countryName = null;


    public String getCountryCode() {
    return countryCode;
    }
    /**
    * @param countryCode The countryCode to set.
    */
    public void setCountryCode(String countryCode) {
    this.countryCode = countryCode;
    }
    /**
    * @return Returns the countryName.
    */
    public String getCountryName() {
    return countryName;
    }
    /**
    * @param countryName The countryName to set.
    */
    public void setCountryName(String countryName) {
    this.countryName = countryName;
    }
    }

    Action---

    CreateCountryForm createCountryForm = new CreateCountryForm();
    List<CountryDTO> countryList = new ArrayList<CountryDTO>();
    createCountryForm.setMarketList(marketList);

  4. #4
    Junior Member
    Join Date
    Dec 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: FAILED TO OBTAIN COLLECTION

    Sorry for the wrong data in action..This is the code in action

    Action----

    CreateCountryForm createCountryForm = new CreateCountryForm();
    List<CountryDTO> countryList = new ArrayList<CountryDTO>();
    createCountryForm.setCountryList(countryList);

Similar Threads

  1. Cannot obtain ' and " in my program
    By sephisel in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 5th, 2013, 10:40 PM
  2. Problem obtain data from excel file via Jersy
    By vector_ever in forum What's Wrong With My Code?
    Replies: 1
    Last Post: July 18th, 2013, 03:01 PM
  3. [SOLVED] How Do I Obtain a Grand Total From My Loop
    By Norm in forum Loops & Control Statements
    Replies: 0
    Last Post: February 4th, 2013, 06:20 PM
  4. how to obtain the combination of ip in String??
    By sxlend in forum Java Networking
    Replies: 2
    Last Post: July 15th, 2012, 01:03 PM
  5. Error using a structure to obtain information of an specific array
    By andresfelquintero in forum What's Wrong With My Code?
    Replies: 4
    Last Post: May 11th, 2011, 06:51 PM