You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Richard Yee <ry...@cruzio.com> on 2003/12/08 07:56:52 UTC

Re: about using DynaActionForm in SQL Maps framework with Struts...

Ricky,
You might have a problem using ibatis SQL Maps with Struts DynaForms. I 
think that Ibatis is going to try and look for a method called 
getAuthor_name() when it would need to use 
DynaForm.get("author_name").  You might try emailing 
clinton.begin@ibatis.com to get a definitive answer.

-Richard

At 10:44 PM 12/7/2003, you wrote:
>hi, there,
>         has anybody tried to use SQL Maps framework with struts? i am now 
> using
>the struts with SQL Maps framework, all is convenient. i have tried to use
>ActionForm instead of create a new javaBean passed to SQL Map parameter.
>just like this:
>
>     AuthorForm authorForm = (AuthorForm) form;
>
>     try {
>       baseDAO.insertAuthor(authorForm);
>     } catch(Exception ex) {
>       ex.printStackTrace();
>     }
>
>now, i have a query about using DynaActionForm in it...
>assume that i am using DynaActionForm and config in struts-config.xml,
>What should i do to pass the dynaformBean to SQL Map parameter?
>some code like these, but it threw some exception...
>
>     DynaActionForm authorForm = (DynaActionForm) form;
>     try {
>       baseDAO.insertAuthor(authorForm);
>     } catch(Exception ex) {
>       ex.printStackTrace();
>     }
>
>and in my BaseDAO.java :
>
>   public void insertAuthor(DynaActionForm author) throws DaoException {
>     try {
>       javaDIYDaoManager.startTransaction();
>
>       authorDao.insertAuthor(author);
>
>       javaDIYDaoManager.commitTransaction();
>     }
>     catch (DaoException e) {
>       try {
>         javaDIYDaoManager.rollbackTransaction();
>       }
>       catch (Exception e2) { /* ignore */}
>       throw ( (DaoException) e.fillInStackTrace());
>     }
>   }
>
>it threw some exception:
>
>Error executing 'insertAuthor' in 'com/dao/sql/Author.xml'.
>
>Check the Parameter Map (or inline parameters).  Check the 'author_name' 
>property.
>
>Cause: com.ibatis.common.beans.BeansException: There is no READABLE 
>property named
>
>'author_name' in class 'org.apache.struts.action.DynaActionForm'
>
>com.ibatis.common.beans.BeansException: There is no READABLE property 
>named 'author_name'
>
>in class 'org.apache.struts.action.DynaActionForm'
>
>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org



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