package hirondelle.fish.main.home;
import hirondelle.fish.main.visit.Visit;
import hirondelle.fish.main.visit.VisitDAO;
import hirondelle.web4j.action.ActionImpl;
import hirondelle.web4j.action.ResponsePage;
import hirondelle.web4j.model.AppException;
import hirondelle.web4j.request.RequestParser;
public final class HomePageAction extends ActionImpl {
public HomePageAction(RequestParser aRequestParser){
super(FORWARD, aRequestParser);
}
public ResponsePage execute() throws AppException {
VisitDAO dao = new VisitDAO();
addToRequest(NEXT_VISIT, dao.fetchNextFutureVisit());
return getResponsePage();
}
private static final ResponsePage FORWARD = new ResponsePage(
"Home", "Home.jsp", HomePageAction.class
);
private static final String NEXT_VISIT = "nextVisit";
}