Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > struts html:option limit?

Reply
Thread Tools

struts html:option limit?

 
 
Girish T Deshpande
Guest
Posts: n/a
 
      07-01-2004
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"%>

<beanarameter id="propertyName" name="propertyName"/>

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

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




Thank You in advance
 
Reply With Quote
 
 
 
 
Murray
Guest
Posts: n/a
 
      07-01-2004

"Girish T Deshpande" <> wrote in message
news: m...
> 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%>" >
<htmlptions 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it safe to point to Internet for locating struts DTD files in struts TLDs and XML files? Katie Wright Java 8 01-07-2005 03:37 PM
[Struts] Newbie - For ActionForm population, must I use Struts taglib? Pratap Das Java 2 04-05-2004 07:42 PM
[Struts]output javascript in struts perform() sin Java 3 02-22-2004 08:27 AM
Integrate a Struts app with a non-struts app jc1771 Java 0 12-28-2003 06:36 PM
Struts Installation - missing struts.tld??? Jason Us Java 0 10-03-2003 11:36 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57