About

2007年06月25日 17:30??????????????????

?????????Hibernate???????????

???????????????

????????????????????????????????????????

Powered by
Movable Type 3.35

« Hibernate??????? | ??? | ????? »

Strus??ActionMessage???

??????????


package hoge.actions;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;
 
public class HogeAction extends Action {
 
  /**
   * Method execute
   * @param ActionMapping mapping
   * @param ActionForm form
   * @param HttpServletRequest request
   * @param HttpServletResponse response
   * @return ActionForward
   * @throws Exception
   */
  public ActionForward execute(
    ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response)
    throws Exception {
 
  // ?????
 
    if (hoge.equals("hoge")) {
      ActionMessages am = new ActionMessages();
   //???????????????????????
      am.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("errors.hoge"));
   //??????
      saveErrors(request, am);
    }
    return mapping.findForward("success");
  }
}

???????

???????????????URL:
http://www.sanryu.net/cgi-bin/mt/mt-tb.cgi/41

???????

(???????????????????????????????????????????????????????????????????????????????????????????????????)

2011年03月
Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31