Hi all,

I have a very strange thing. I have a multiple select in my JSP, and a
List<Long> of ids in my Action. When I submit the form, I iterate on that
List of Long, and I have this error :

java.lang.ClassCastException: java.lang.String

Struts has String in the List instead of Long. The strange thing is that it
appends on some servers (TomCat 5.5) but not on other : it works on my local
computer, bug on the test server, works on the production server, and works
on all other servers.

I first thought it was a Struts dtd cache version problem on the Eclipse of
the person building the WAR, but I have the same problem on my Eclipse
(which build working WAR for other servers).

We copied all jars files from shared/lib of a working TomCat to the bugging
TomCat, but it doesn't fix the problem.

Did someone already see such a thing ? Do you have an idea of where it could
bug ?

Thanks a lot.

Here is my code :

JSP : (id is a long, nomComplet is a String)
                        <s:select       id="selectCommercial"
                                                name="idsCommerciaux" 
                                                list="listCommercial"
                                                listKey="id"
                                                listValue="nomComplet" 
                                                cssStyle="width: 200"
                                                emptyOption="true"
                                                multiple="true"
                                                size="10">
                        </s:select>

Action :
        private List<Long> idsCommerciaux;
        public List<Long> getIdsCommerciaux() {
                return idsCommerciaux;
        }
        public void setIdsCommerciaux(List<Long> idsCommerciaux) {
                this.idsCommerciaux = idsCommerciaux;
        }

        for (Long unCommercial : idsCommerciaux) { //ClassCastException here

Struts2 version : 2.1.0


-- 
View this message in context: 
http://www.nabble.com/Random-ClassCastException-%3A-I%27m-expecting-Long%2C-Struts-gives-me-String-on-some-servers...-tp21722894p21722894.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to