I have implemented dusty's recommendation. It worked really well.

One thing to note - add your listener at the end of other listeners in the
web.xml.

Thanks!



Bingu wrote:
> 
> Hi all,
> 
>  
> 
> I want to add simple drop down list in a JSP page with my Struts2 web
> application on AppFuse framework. I went through related post in web and
> tried to do it with StartupListener class.
> 
>  
> 
> I created/modified following classes/jsp.
> 
>  
> 
> 1.       Created Statuses POJO. 
> 
> Not used for the time being
> 
>  
> 
> 2.       Constant
> 
> public static final String AVAILABLE_STATUSES =  "availableStatuses";
> 
>  
> 
> 3.       StartupListner
> 
> context.setAttribute(Constants.AVAILABLE_STATUSES ,
> mgr.getObjects(TaskStatuses.class));
> 
>  
> 
> 4.       LookupManager
> 
> public List<LabelValue> getObjects(Class<TaskStatuses> name);
> 
>  
> 
> 5.       LookupManagerImpl
> 
> public List<LabelValue> getObjects(Class<TaskStatuses> name) {
> 
>       List<LabelValue> list = new ArrayList<LabelValue>();
> 
>       list.add(new LabelValue("PENDING", "PENDING"));
> 
>       list.add(new LabelValue("OPEN", "OPEN"));
> 
>       list.add(new LabelValue("DONE", "DONE"));
> 
>       list.add(new LabelValue("HOLD", "HOLD"));
> 
>       return list;
> 
> }
> 
>  
> 
> 6.       taskForm.jsp
> 
> <html:select property="status">  
> 
>       <html:options collection="availableStatuses" property="status"
> labelProperty="name"/>  
> 
> </html:select>
> 
>  
> 
>  
> 
>  
> 
> I was struggling with this whole yesterday and I could not populate drop
> down-list in my jsp. I don't even get error in JSP page. Is it do
> something
> with tag libraries in? Any configuration XML file? Can you tell me where
> else I need to change/correct. 
> 
>  
> 
> If anyone has sample code on this or a place where I can find them pls let
> me know.
> 
>  
> 
> Thanks &Regards,
> 
> Bandula
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Drop-Down-List-tp17582948s2369p21209692.html
Sent from the AppFuse - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to