JOSE L MARTINEZ-AVIAL wrote: > > Well, the NPE is due to the fact that you are setting declaring dt_oid as > an > Integer(which can be null) but in the method listdomain is an int. The JVM > automatically tries to convert Integer to int, but if it's null, it will > throw a NPE, since an int can not be null. That's the first thing you > should > look at. Also, who and when is setting dt_oid? Because there is no such > field in the jsp, so it will always be empty. And you will always get that > exception. > > Second, if you want to fill the domaintype in the bean, as the rest of > fields, you will need to rename the select to listbean.domainType, as the > rest of fields in the form. Otherwise it will not be loaded in the bean. > Also, you should revise the logic used to create the ids in the DAO. As it > stands, the objectid will always be 1. > > Third, IMO your code is hard to read. If you create an object of class > DomainBean, do not call it listbean, because everybody that reads it will > be > puzzle why something that is not a list is called list. > > Well, first off I sincerely apologize for using an improper naming technique I'm totally new to coding in itself :s. As Suggested ,Ive changed the return value of dt_oid and objid across the code . And im trying to set it through the jsp by modifying the select tag . as below. <s:select headerKey="-1" headerValue="--Select--" list="dtList" listValue="listbean.code" listValue="listbean.dt_oid" name="listbean.domainType" onchange="function1(this)" />. I'm not sure how far this is effective though as the drop down form the jsp is empty . Even though the source shows the various options. Also I dont understand what you mean by creating the ids,could you please explain?
-- View this message in context: http://struts.1045723.n5.nabble.com/loading-Dropdown-dynamically-from-database-tp3555885p3766102.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