hi,
I am learning
struts by using Javaranch newsletter link
http://www.javaranch.com/newsletter/Mar2002/newslettermar2002.jsp#struts I have installed
tomcat 1.4.1 and as that link said I created LoginBean.java with the following code
package test.struts;
import javax.servlet.http.*;
import org.apache.struts.action.*;
public class LoginBean {
String userType, userId ,passWord;
public LoginBean() {}
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.login"));
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.login"));
return ae;
}
return null;
}
public String getUserType() {
return userType;
}
public void setUserType(String userType) {
this.userType = userType;
}
}
I am using jdk1.4 but when I compiled this file it's saying javax.servlet is not found I don't know where to save this file.What do I need to do for recognizing javax package.
thanks
alot