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 [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to