Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old February 16th, 2004, 05:04 PM
Registered User
 
Join Date: Feb 2004
Location: , , .
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.
:)
Reply With Quote
  #2 (permalink)  
Old February 23rd, 2004, 10:31 AM
Registered User
 
Join Date: Jan 2004
Location: , , Israel.
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 ???
Reply With Quote
  #3 (permalink)  
Old February 25th, 2004, 01:21 PM
Registered User
 
Join Date: Feb 2004
Location: , , .
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. :)

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 03:12 PM
JSP web Development ch-18 struts problem wilson_kwan JSP Basics 0 December 12th, 2004 12:17 PM
Who have the code of Beginning jsp web development Robertzang JSP Basics 2 September 5th, 2003 03:49 AM



All times are GMT -4. The time now is 02:15 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.