エラーの設定
public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ActionMessages ms = new ActionMessages(); ActionMessage m = new ActionMessage("key"); //MessageResourceに設定したKey ms.add(ActionMessages.GLOBAL_MESSAGE, m); //第1引数はエラー表示時のProperty saveErrors(request, ms); return mapping.findForward("error"); }
エラーの表示
<html:errors /> <html:errors header="false" footer="false" property="userId" /> <html:messages id="message" property="<%= org.apache.struts.action.ActionMessages.GLOBAL_MESSAGE %>"> とか。
[カテゴリ: プログラミング言語 > Servlet & Struts]
[通知用URL]
Tweet
最終更新時間:2008年05月25日 22時55分49秒