why do we typecast ActionForm into out plain java bean
class in Action class?
Answers were Sorted based on User's Feedback
Answer / jagadeesh b.n
Bcoz as u all know, casting are of 2 types Upcast(implicit)
and Downcast(Explicit)in core java.....Upcasting means
converting lower datatype(int) to higher datatype(long) and
Downcast means its a viceversa of upcast...(long to int)...
As u know in struts ActionForm is a superclass where as ur
Java bean program is a simple class with private fields and
set/get methods for conversion of superclass to sublclass
we use typecasting in struts...
| Is This Answer Correct ? | 5 Yes | 1 No |
Answer / ravikiran(aptech mumbai)
Because The methods what we declared in a bean are not of
type ActionForm class type that's why we are type casting
and calling our getters and setters
| Is This Answer Correct ? | 3 Yes | 2 No |
Answer / santhoshkumar.shaik
ok here our our form data in ActionForm
that's y u shoud do down Type Cast
othere wise u can n't use
| Is This Answer Correct ? | 0 Yes | 2 No |
Answer / johndoe
Acctually not realy thinking you should ask that, i mean
well ask, the answer is: to use it's methods.
But to understand it i recomend reading something about
polymorphy which explains why we're casting the action-
form, hope i understood right.
Regards
Jan
| Is This Answer Correct ? | 2 Yes | 7 No |
Which technologies can be used at view layer in struts?
Do we need to pay the struts if being used in commercial purpose?
session menagement in servlets explaion briefly?
How can we get Servlet API Request, Response, HttpSession etc Objects in action classes?
What is the purpose of @stringlengthfieldvalidator annotation?
What do you mean by tiles in struts?
What’s the difference between validation.xml and validator-rules.xml files in struts validation framework?
Difference between struts and spring? Or why use spring, if you are already using struts?
What is the purpose of @result annotation?
struts 1.3 features?
what r the disadvantages of MVC-2 Architecture?
What is Portlet???? when,where and why we use it ??
3 Answers Infotech, Rebaca, Wipro,