Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
|
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics 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, 2004, 06:04 PM
Registered User
 
Join Date: Feb 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Beginning JSP Web Development Book - Struts questi

I am trying to compile the ValidateEmployeeAction class and I get:
"cannot resolve symbol" error on the line of code that tries to cast the ActionForm parameter to the application ActionForm EmployeeForm class we need to specify here is the begining snippet that causes the problem:
"// This is the Action class ValidateEmployeeAction.java

package com.example;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionError;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;

import java.io.IOException;
import java.util.List;

public class ValidateEmployeeAction extends Action
{
    public ActionForward perform(ActionMapping mapping,
            ActionForm form,
            HttpServletRequest request,
            HttpServletResponse response) throws IOException,ServletException
    {
        ActionErrors errors = new ActionErrors();
        EmployeeForm empForm = (EmployeeForm)form; ---This is the error line"

I am guessing it cannot find the EmployeeForm class but I don't know why? I wrote exactly as it is in the book. Maybe I am missing something...sorry I know I am.
Any help is appreciated. Thank you in advance.
:)
 
Old February 23rd, 2004, 11:31 AM
Registered User
 
Join Date: Jan 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to IgorT
Default

perhaps you EmployeeForm is not in the same package com.example ???
 
Old February 25th, 2004, 02:21 PM
Registered User
 
Join Date: Feb 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by IgorT
 perhaps you EmployeeForm is not in the same package com.example ???
Thanks for the feedback. I actually had to compile them all together using:

javac *.java

and then it compiled OK. I am still having problem trying to compile classes that reside in different packages. Do all classes have to be in the same folder when they are compiled for all of this to work? Any information on compiling classes and packages?
Thanks very much. :)






Similar Threads
Thread Thread Starter Forum Replies Last Post
Help me! about "beginning JSP Web Development" ddgfei JSP Basics 7 May 13th, 2006 12:52 PM
Next levet after "Beginning JSP Web Development" nolas JSP Basics 0 September 29th, 2005 04:58 AM
Beginning JSP Web Development - Ch08 Cyclops All Other Wrox Books 0 January 31st, 2005 04:12 PM
JSP web Development ch-18 struts problem wilson_kwan JSP Basics 0 December 12th, 2004 01:17 PM
Who have the code of Beginning jsp web development Robertzang JSP Basics 2 September 5th, 2003 03:49 AM





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