寻求一个替代方法
这个程序编译(Struts)出现以下错误!那位高手知道替换的方法!!我用的是jdk1.5 tomcat 5.5
---------------------------------------------------------------------------------------------------------
// Java Document
package mypack;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
public class LoginForm extends ActionForm{
private String password=null;
private String username=null;
//Password Accessors
public String getPassword(){
return (this.password);
}
public void setPassword(String password){
this.password=password;
}
//Username Accessor
public String getUsername(){
return (this.username);
}
public void setUsername(String username){
this.username=username;
}
//This method is called with every request.It resets the Form
//attribute prior to setting the value in the new request.
public void reset(ActionMapping mapping,HttpServletRequest request){
this.password=null;
this.username=null;
}
public ActionErrors validate(ActionMapping args0,HttpServletRequest arg1){
ActionErrors errors=new ActionErrors();
if (username==null || username.equals("")){
errors.add("username",new ActionError("error.username"));
}
return errors;
}
}
---------------------------------------------------------------------------------------------------------
D:\jsp\tomcat\tomcat 5.0\webapps\struts\src\mypack>javac LoginForm.java
注意:LoginForm.java 使用或覆盖了已过时的 API。
注意:要了解详细信息,请使用 -Xlint:deprecation 重新编译。
D:\jsp\tomcat\tomcat 5.0\webapps\struts\src\mypack>javac -Xlint:deprecation Log
inForm.java
LoginForm.java:8: 警告:[deprecation] org.apache.struts.action 中的 org.apache.s
truts.action.ActionError 已过时
import org.apache.struts.action.ActionError;
^
LoginForm.java:58: 警告:[deprecation] org.apache.struts.action 中的 org.apache.
struts.action.ActionError 已过时
errors.add("username",new ActionError("error.username"))
;
^
LoginForm.java:58: 警告:[deprecation] org.apache.struts.action.ActionErrors 中
的 add(java.lang.String,org.apache.struts.action.ActionError) 已过时
errors.add("username",new ActionError("error.username"))
;
^
3 警告
---------------------------------------------------------------------------------------------------------------
谢谢!!!!!!!!!!!!!!!!