You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Caroline Jen <ji...@yahoo.com> on 2003/07/19 05:14:41 UTC

package org.apache.struts.action Does Not Exist?

I have been using Struts (jakarta-struts-1.1-rc2) for
about two weeks. I have tested a number of things and
made them work.

Today, while I was trying to compile a model bean (I
have compiled it before without any problem), I got
compilation error: 
package org.apache.struts.action does not exist

I double checked that the struts.jar is in the
$TOMCATHOME\webapps\MyApplication\WEB-INF\lib
directory. What could have happened?

The source code of my model bean is:

package resources.version1;

import javax.servlet.http.*;
import org.apache.struts.action.*;


public class LogonBean {

	String userType, userID ,password;

	public LogonBean() {}

	public void setParameters(HttpServletRequest request)
{
		userID = request.getParameter("userID");
		password = request.getParameter("password");
	}

	public ActionErrors validate() {

		if (!userID.equals(password)) {
			ActionErrors ae = new ActionErrors();
			ae.add("userID", new
ActionError("error.invalid.logon"));
			return ae;
		}

		if (userID.equals("admin")) {
			userType = "Adminstrator";
		} else
		if (userID.equals("user")) {
			userType = "User";
		} else {
			ActionErrors ae = new ActionErrors();
			ae.add("userID", new
ActionError("error.invalid.logon"));
			return ae;
		}

		return null;
	}

	public String getUserType() {
		return userType;
	}

	public void setUserType(String userType) {
		this.userType = userType;
	}
}		



__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org