You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Yaman Kumar <ya...@nous.soft.net> on 2001/05/15 15:16:34 UTC
RE: class cast exception
Hi,
Can You check action element attributes in action-mappings element in
struts-config.xml element.
Ex: some thing like below
<form-beans>
<form-bean name = "myActionForm "
type = "fullpath to MyActionForm"/>
</form-beans>
<action-mappings>
<action path = "/strutsaction"
type = "Path to StrutsAction Class"
name = "myActionForm ">
<forward name="success" path="/Success.jsp"/>
</action>
</action-mappings>
hope it helps
rayaku
-----Original Message-----
From: Thorsten Maus [mailto:maus@webmeals.de]
Sent: Wednesday, 15 May 2002 6:40 PM
To: struts-user
Subject: class cast exception
hi there ...
i always get a class cast excpetion when trying to cast the form-class
is there anybody who is able to tell me what is wrong in my form-class ????
public class StrutsAction extends Action{
public StrutsAction() {
}
public ActionForward perform(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
{
MyActionForm myActionForm = (MyActionForm) form;
//myActionForm.setParam1("_new value");
return mapping.findForward("forward");
}
}
public class MyActionForm extends ActionForm {
private String param1;
public String getParam1(){
return param1;
}
public void setParam1(String param){
this.param1=param;
}
}
thanks in advance
thorsten
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>