struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <lukasz.len...@googlemail.com>
Subject Re: ClassCastException com.dev.model.Form cannot be cast to java.lang.String
Date Tue, 24 Mar 2009 16:19:35 GMT
2009/3/24 foward <foward@gmail.com>:
> the method getForm() return a object Form where before with the respective
> id is obtained and returned.

You put method getForm() in s:form as a action, which means such
method will be called by Struts 2 and the framework will expect a
String - result name, which you have to define in struts.xml.
You shouldn't return an object like Form. To do that, implement
ModelDriven interface and return your Form object from method
getModel() and in your jsp use ${name} instead ${form.name}

> Yes I m reading a book struts in action, I don't know if you recomend me a
> good one.

That is good one


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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


Mime
View raw message