package com.javahonk.action;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

@Results({ @Result(name = "error", location = "/index.jsp"),
		@Result(name = "success", location = "/success.jsp"),
		@Result(name = "input", location = "/index.jsp") })
public class ModelDrivenAction extends ActionSupport implements ModelDriven<Person>{

	private static final long serialVersionUID = 1L;
	
	@Override
	@Action(value = "/modelDrivenAction")
	public String execute() throws Exception {

		return ActionSupport.SUCCESS;
	}

	/* (non-Javadoc)
	 * @see com.opensymphony.xwork2.ModelDriven#getModel()
	 */
	public Person getModel() {
		return new Person();
	}

}
