0,0 → 1,41 |
package ak.photoalbum.webapp; |
|
import javax.servlet.http.HttpServletRequest; |
import javax.servlet.http.HttpServletResponse; |
import org.apache.struts.action.ActionMapping; |
import org.apache.struts.action.ActionForm; |
import org.apache.struts.action.ActionForward; |
import org.apache.log4j.Logger; |
|
public final class PageAction |
extends BaseAction |
{ |
private static final Logger logger = Logger.getLogger(IndexAction.class); |
|
public ActionForward executeAction(ActionMapping mapping, ActionForm form, |
HttpServletRequest request, HttpServletResponse response) |
throws Exception |
{ |
PathForm theForm = (PathForm)form; |
String page = theForm.getPath(); |
IndexEntry entry = new IndexEntry(); |
IndexEntry index = new IndexEntry(); |
IndexEntry prev = new IndexEntry(); |
IndexEntry current = new IndexEntry(); |
IndexEntry next = new IndexEntry(); |
|
if(page == null) page = ""; // the images root |
|
logger.info("get page " + page); |
Logic.getLogic().getEntry(page, entry, index, prev, current, next); |
|
request.setAttribute("page", page); |
request.setAttribute("entry", entry); |
request.setAttribute("index", index); |
request.setAttribute("prevEntry", prev); |
request.setAttribute("current", current); |
request.setAttribute("nextEntry", next); |
|
return mapping.findForward("success"); |
} |
} |