struts超简单入门(三)
写三个java类,编译后放到Tomcat 5.0webappsstrutsWEB-INFclassescomjaver eststruts目录下
【HelloFrom.java】:
package com.javer.test.struts;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
public final class HelloFrom
extends ActionForm
{
private String person = null;
public String getPerson()
{
return person;
}
public void setPerson(String person)
{
this.person = person;
}
public void reset(ActionMapping mapping, HttpServletRequest request)
{
this.person = null;
}
public ActionErrors validate(ActionMapping mapping,HttpServletRequest request)
{
ActionErrors errors = new ActionErrors();
if(this.person==null || this.person.length()
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/374079/viewspace-131277/
,如需转载,请注明出处,否则将追究法律责任。