package com.ibatis.jpetstore.presentation.action;

import com.ibatis.jpetstore.domain.*;
import org.apache.struts.action.*;

import javax.servlet.http.*;

public class ViewItemAction extends BaseAction {

  /* Public Methods */

  public ActionForward doPerform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {

    String itemId = request.getParameter("itemId");

    Item item = petStore.getItem(itemId);
    request.setAttribute("item", item);
    request.setAttribute("product", item.getProduct());

    return mapping.findForward("success");

  }


}
