struts html:option limit?

Discussion in 'Java' started by Girish T Deshpande, Jul 1, 2004.

  1. Hi,

    I have 350 options <html:select>, but the WebLogic 7.2 is complaining
    about it and unablue to compile. I commented about 50 options and its
    displaying them successfully. Is there any limit for the number of
    options.
    I must have 350 options in <html:select>
    Any suggestions, code help is greatly appreciated.

    <%@ include file="/include/struts.jsp"%>

    <bean:parameter id="propertyName" name="propertyName"/>

    <html:select property="<%=propertyName%>" >

    1 <html:eek:ption value="AIMX">AIMX</html:eek:ption>
    2 <html:eek:ption value="XALB">ALBERTA SE</html:eek:ption>
    3 <html:eek:ption value="XALG">ALGIERS SE</html:eek:ption>
    ...............................
    .......................................
    ........................................
    349 <html:eek:ption value="XZIM">ZIMBABWE SE</html:eek:ption>
    350 <html:eek:ption value="ZOBX">ZOBEX</html:eek:ption>
    </html:select>




    Thank You in advance
     
    Girish T Deshpande, Jul 1, 2004
    #1
    1. Advertising

  2. Girish T Deshpande

    Murray Guest

    "Girish T Deshpande" <> wrote in message
    news:...
    > Hi,
    >
    > I have 350 options <html:select>, but the WebLogic 7.2 is complaining
    > about it and unablue to compile. I commented about 50 options and its
    > displaying them successfully. Is there any limit for the number of
    > options.
    > I must have 350 options in <html:select>


    There's no limit on the number of options per se, and it has nothing to do
    with Struts really. It is because the class file that is generated from the
    jsp is too big (believe it or not there is a limit, which I think is
    JVM-specific), or a method in the class is too big.

    I'd probably do this:
    <html:select property="<%=propertyName%>" >
    <html:eek:ptions collection="countries" property="countryCode"
    labelProperty="countryName"/>
    </html:select>

    where countries is a collection of beans representing a country (with
    properties countryCode and countryName). Generate the list in the Action and
    put it on the request. If the same list is going to be used in multiple
    places, I'd consider making it a singleton/static list.

    Another possible solution is to split the file and jsp:include the second
    half into the first. But in your case I don't think it will help since just
    the html:select block itself is probably big enough to cause a compilation
    error.
     
    Murray, Jul 1, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Julien ROUZIERES

    g++ -pg option and -shared option

    Julien ROUZIERES, Dec 21, 2004, in forum: C++
    Replies:
    1
    Views:
    777
    GianGuz
    Dec 21, 2004
  2. Cas
    Replies:
    5
    Views:
    819
    Kevin Jones
    Aug 28, 2006
  3. Kevin Blount

    page.aspx?option - how to detect "option"

    Kevin Blount, Nov 28, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    632
    =?Utf-8?B?RWVyYWo=?=
    Nov 28, 2006
  4. Replies:
    1
    Views:
    1,144
    Victor Bazarov
    Jun 28, 2005
  5. Replies:
    4
    Views:
    807
    Tim Greer
    Dec 1, 2008
Loading...

Share This Page