File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes  cannot cast org apache struts action.Action? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark " cannot cast org apache struts action.Action?" Watch " cannot cast org apache struts action.Action?" New topic

cannot cast org apache struts action.Action?

Yashnoo lyo
Ranch Hand

Joined: Feb 17, 2003
Posts: 152
Hi everyone:
I have wrote two javabean for struts.One is LogonForm and another is LogonAction.But I really don't know whether Jdk1.3 support struts1.0.Compiler report error When I compile the LogonAction and it says:" Error #: 364 : cannot cast org.apache.struts.action.ActionForm to app.LogonForm at line 13, column 34
".It point to "String username=((LogonForm)form).getUsername();".Why this? I have already added the struts.jar to classpath and my compiler.Struts examples run successfully under Tomcat4.Can anyone help me?

When I face C# and Java I choose Java.
Ajith Kallambella

Joined: Mar 17, 2000
Posts: 5782
Moving to Java Frameworks forum...

Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Junilu Lacar

Joined: Feb 26, 2001
Posts: 4442

Did you check if LogonForm extends ActionForm?
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: cannot cast org apache struts action.Action?
Similar Threads
primitive types in collections
Struts 1.0 issue with ActionForm
Validator Problems
struts.action.PlugIn Class cast issue in Struts on JBoss server
populating the databse