struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ganesh gadi <ganeshi...@yahoo.com>
Subject how to submit values from same multiple <html:select><html:options> to insert into d/b
Date Thu, 27 May 2004 06:48:34 GMT
Hi friends.
This is the problem of inserting selected values from 
<html:select><html:options> from jsp.
 
I give u in detailed code of mine.Pls observe it and answer .i'm very thankful to u.
 
<bean:define name="createUserActionForm" property="clientList" id="clients"/>
 
<tr>
 <td>
      <html:select styleId="selectc1" property="clientList" tabindex="26" >
         <html:options collection="clients" property="clientid"  labelProperty="firstname"/>
      </html:select>
   </td>
   <td>
      <html:select styleId="selectc2" property="clientList" tabindex="26" >
         <html:options collection="clients" property="clientid"  labelProperty="firstname"/>
      </html:select> 
   </td>
   <td>
      <html:select styleId="selectc3" property="clientList" tabindex="26" >
         <html:options collection="clients" property="clientid"  labelProperty="firstname"/>
      </html:select> 
   </td>
</tr>
 
 
And corresponding formbean:
 
private String[] clientid;

  public String[] getClientid(){
    return this.clientid;
  }
  public void setClientid(String[] clientids){
    this.clientid=clientids;
  }
 
 
I'm getting the values from database and able to display them in select box.
 
Problems:
1)
    i'm not able to insert selected values in database.i.e,i'm not getting the values from
form
2)
   Is there any way to write down the above 3 select boxes in a single line .i.e.,can mention
select box onetime and repeat the <td>.

When i submitting the form i'm getting the following exception:
 
javax.servlet.ServletException: BeanUtils.populate
 org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1254)
 org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)
 org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
 org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
 org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

root cause 
java.lang.IllegalArgumentException: argument type mismatch
 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 java.lang.reflect.Method.invoke(Method.java:324)
 org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1789)
 org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.java:1684)
 org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:1713)
 org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:1019)
 org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
 org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)
 org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)
 org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
 org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
 org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

 
awaiting ur reply.pls very very urgent.
 
Advance Thanks & Regards
Ganesh



		
---------------------------------
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message