| Author |
inconvertible types problem with struts tutorial
|
Tony Evans
Ranch Hand
Joined: Jun 29, 2002
Posts: 521
|
|
I am currently working my way through a struts tutorial, I have a problem with the following code: String username = ((LoginForm)form).getUsername(); I get the following compilation error: apressstruts/LoginAction.java [49:1] inconvertible types found : org.apache.struts.action.ActionForm required: apressstruts.LoginForm String username = ((LoginForm)form).getUsername(); ^ This is a direct snippet from the apache struts tutorial. public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String user = null; String target = new String("Success"); //Get parameters from the login Form String username = ((LoginForm)form).getUsername(); return null; } Thanks for any help. Tony
|
 |
Tony Evans
Ranch Hand
Joined: Jun 29, 2002
Posts: 521
|
|
Sorted the problem forgot to make LoginForm extend ActionForm. Tony
|
 |
 |
|
|
subject: inconvertible types problem with struts tutorial
|
|
|