Wrox Programmer Forums
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Struts section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 16th, 2007, 02:04 PM
Registered User
 
Join Date: Oct 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to sparun1607
Default ActionForm

Can anybody tell why we need to cast the ActionForm in Action Class
for eg:

If this CustomActionForm extends ActionForm

public class CustomActionClass extends Action
{

ActionForward excute(ActionMapping mapping,ActionForm,HttpServletRequest request,HttpServletResponse response)
{
// (Why we need to do this for getting a value since it is submitted in the CustomActionForm)
CustomActionForm caf = (CustomActionForm)form;

}

}

Arun
 
Old March 11th, 2007, 10:20 PM
Registered User
 
Join Date: Mar 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Since the form is of type ActionForm you need to narrow its type down to the type you want to use. THus you will typically cast it to the form bean you have for your page






Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set up classpath for strust ActionForm Befekadu Apache Tomcat 0 July 28th, 2005 09:50 AM
Help in ActionForm validation bgopal2005 J2EE 1 February 25th, 2005 08:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.