Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Cannot cast from ActionForm to StudentForm

807603Jan 15 2005 — edited Jan 15 2005
Hi All,
I am getting this Eroor


Cannot cast from ActionForm to StudentForm

public ActionForward execute(ActionMapping mapping,
	                                 ActionForm form,
	                                 HttpServletRequest request,
	                                 HttpServletResponse response)
	        throws Exception {
	        StudentService service = new StudentService();
	        StudentForm studentForm = (StudentForm) form; //Error is shown here...
	        StudentDTO studentDTO = new StudentDTO();
	        BeanUtils.copyProperties( studentDTO, studentForm );
	        service.insertStudent( studentDTO );
	        request.setAttribute("employee",studentDTO);
	        return (mapping.findForward("success"));
	    }
Any help would be greatly appreciated.

Thanks
AS

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Feb 12 2005
Added on Jan 15 2005
6 comments
1,265 views