I believe you faced this error thats why you are here for the solution.
Instead of wasting our time straightly we will go to the solution.
Thats it your code will work like a charm.Instead of wasting our time straightly we will go to the solution.
struts.xml
/jsp/selectBox.jsp
SelectList.java
package com.demo.actions; import com.opensymphony.xwork2.ActionSupport; import java.util.*; public class SelectList extends ActionSupport{ private ArrayListdayList; public String execute() throws Exception { //instantiate the Arraylist here dayList = new ArrayList (); dayList.add("monday"); dayList.add("tuesday"); ... dayList.add("sunday"); return SUCCESS; } //Make sure you have created the getter and setter method for ArrayList public ArrayList getDayList() { return dayList; } public void setDayList(ArrayList dayList) { this.dayList= dayList; } }
selectBox.jsp
Do post your comments and for more java programming click this Link.
2 comments:
Thanks.
Keep posting.
Great Article
Struts Online Training
Struts 2 Online Training
Struts Training in Chennai
Struts 2 Training
Post a Comment