I have a LookupDispatchAction behind what is basically a CRUD form. The
read part works fine, but when I go to update, I get this.
javax.servlet.ServletException: argument type mismatch
at
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.
java:526)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces
sor.java:467)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:523)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
The stack trace here is not helpful at all, but another message in the
archives pointed me at the 'copyProperties' call as the possible culprit.
I found that in the 'read' method, I have
DynaValidatorForm dvForm = (DynaValidatorForm) form;
BeanUtils.copyProperties( dvForm, contact );
while the update method has:
PropertyUtils.copyProperties( contact, contactForm );
I'm guessing that BeanUtils is the way to go, considering that it's the one
that's working, but I don't understand the difference between BeanUtils and
PropertyUtils, or when I should use one instead of the other. The API docs
aren't too enlightening... it looks like both of these classes do the same
thing.
Is there a document out there that would clear things up, or does anyone
have any advice? (This is a Struts app and the properties are being copied
from/to a DynaValidatorForm and the data transport object.)
Thanks!
--
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management