struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Riyad Kalla <...@email.arizona.edu>
Subject Re: "No Name Specified" Error
Date Tue, 27 Apr 2004 21:47:18 GMT
Hey nice job! Now I just learned something new too.

Shyamal Shah wrote:

>Thanks for the help. Finally I got it to work :) . I created a get method in
>my form that returns collection and used the name as property with
>optionsCollection.
>i.e. public Collection getRegions()
>
>and in my JSP,
><html:optionsCollection property="regions">
>
>Worked perfectly :)
>
>
>----- Original Message ----- 
>From: "Riyad Kalla" <rsk@email.arizona.edu>
>To: "Struts Users Mailing List" <user@struts.apache.org>
>Sent: Tuesday, April 27, 2004 4:23 PM
>Subject: Re: "No Name Specified" Error
>
>
>  
>
>>Well the difference is that I'm putting objects into my arraylist, not
>>strings. So for my DTOs, I have something like this:
>>
>>Action:
>>List userList = UserDAO.getAllUsers();
>>session.setAttribute("userList", userList);
>>
>>JSP:
>><html:select name="someForm" property="whatever">
>>    <html:optionsCollection name="userList" label="userName"
>>value="userID" />
>></html:select>
>>
>>So "userList" is pulled out of my session and used, and for each
>>element, "getUserName()" is used for the option label, and "getUserID()"
>>is used for the option value. This is why I'm not sure how to do it with
>>Strings, because they don't have getter methods like this.
>>
>>Best,
>>Riyad
>>
>>Shyamal Shah wrote:
>>
>>    
>>
>>>This damn piece still doesnt work :( . Can you tell me how do you add
>>>      
>>>
>values
>  
>
>>>in array list in your action class and how you access it in JSP using
>>>optionsCollection? may be I can try to mimic the same...
>>>
>>>----- Original Message ----- 
>>>From: "Riyad Kalla" <rsk@email.arizona.edu>
>>>To: "Struts Users Mailing List" <user@struts.apache.org>
>>>Sent: Tuesday, April 27, 2004 3:04 PM
>>>Subject: Re: "No Name Specified" Error
>>>
>>>
>>>
>>>
>>>      
>>>
>>>>I think its "optionsCollection" singular...
>>>>
>>>>Shyamal Shah wrote:
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>>>If I try using html:optionsCollections it says
>>>>>"no handler for tagname='optionsCollections'
>>>>>"
>>>>>
>>>>>Do I have to do something differently? or include anything to get it to
>>>>>work?
>>>>>
>>>>>----- Original Message ----- 
>>>>>From: "Riyad Kalla" <rsk@email.arizona.edu>
>>>>>To: "Struts Users Mailing List" <user@struts.apache.org>
>>>>>Sent: Tuesday, April 27, 2004 2:15 PM
>>>>>Subject: Re: "No Name Specified" Error
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>I think you want to be using html:optionsCollectios, and you need
to
>>>>>>specify a "name" argument to tell the tag which session object to
use.
>>>>>>I've NEVER had success using the "collection" param on ANY Struts
tag,
>>>>>>no matter what I do. I always use name and it works like a dream.
>>>>>>
>>>>>>Shyamal Shah wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>            
>>>>>>
>>>>>>>Hi,
>>>>>>>I am trying to load arraylist values into select box on my JSP
page.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>              
>>>>>>>
>>>>>It somehow doesnt work and everytime throws "No name specified" error.
>>>>>          
>>>>>
>I
>  
>
>>>>>know it happened to someone some time back but couldnt find answer in
>>>>>archive. Can someone pls tell me what would be the resolution?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>In my action class I'm doing following:
>>>>>>>
>>>>>>>session = request.getSession();
>>>>>>>java.util.ArrayList regionArr = new java.util.ArrayList();
>>>>>>>regionArr.add("-All-");
>>>>>>>regionArr.add("1");
>>>>>>>regionArr.add("2");
>>>>>>>regionArr.add("3");
>>>>>>>regionArr.add("4");
>>>>>>>regionArr.add("5");
>>>>>>>
>>>>>>>session.setAttribute("RegionList",regionArr);
>>>>>>>
>>>>>>>And in my JSP , I have following code..
>>>>>>>
>>>>>>><html:select property="region" name="SearchBTNForm">
>>>>>>> <html:options collection="RegionList" />
>>>>>>></html:select>
>>>>>>>
>>>>>>>where is it going wrong? someone suggested to use toArray() on
array
>>>>>>>
>>>>>>>
>>>>>>>              
>>>>>>>
>>>list
>>>
>>>
>>>      
>>>
>>>>>>>              
>>>>>>>
>>>>>in action class while setting the session object but that also is not
>>>>>          
>>>>>
>of
>  
>
>>>>>          
>>>>>
>>>any
>>>
>>>
>>>      
>>>
>>>>>help. I'll appriciate any suggestions..
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>Thanks,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>              
>>>>>>>
>>>>>>---------------------------------------------------------------------
>>>>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>>>For additional commands, e-mail: user-help@struts.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>            
>>>>>>
>>>>>---------------------------------------------------------------------
>>>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>>For additional commands, e-mail: user-help@struts.apache.org
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>  
>

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


Mime
View raw message