本文整理汇总了Java中org.seasar.struts.enums.SaveType类的典型用法代码示例。如果您正苦于以下问题:Java SaveType类的具体用法?Java SaveType怎么用?Java SaveType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SaveType类属于org.seasar.struts.enums包,在下文中一共展示了SaveType类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleThrowable
import org.seasar.struts.enums.SaveType; //导入依赖的package包/类
/**
* 例外を処理します。
*
* @param e
* 例外
* @param invocation
* メソッド呼び出し
* @return 戻り先の名前
* @throws Throwable
* 例外が発生した場合
*/
public String handleThrowable(ActionMessagesException e,
MethodInvocation invocation) throws Throwable {
HttpServletRequest request = RequestUtil.getRequest();
if (e.getSaveErrors() == SaveType.REQUEST) {
request.setAttribute(Globals.ERROR_KEY, e.getMessages());
} else {
HttpSession session = request.getSession();
session.setAttribute(Globals.ERROR_KEY, e.getMessages());
}
S2ExecuteConfig executeConfig = S2ExecuteConfigUtil.getExecuteConfig();
if (executeConfig.getInput() != null) {
return executeConfig.resolveInput(S2ActionMappingUtil
.getActionMapping());
}
return S2ActionMappingUtil.getActionMapping().getInput();
}
示例2: testSetupMethod
import org.seasar.struts.enums.SaveType; //导入依赖的package包/类
/**
* @throws Exception
*/
public void testSetupMethod() throws Exception {
S2ActionMapping actionMapping = customizer
.createActionMapping(getComponentDef("aaa_bbbAction"));
S2ExecuteConfig executeConfig = actionMapping
.getExecuteConfig("execute");
assertNotNull(executeConfig);
assertNotNull(executeConfig.getMethod());
assertFalse(executeConfig.isValidator());
assertEquals(1, executeConfig.getValidationConfigs().size());
assertEquals(SaveType.REQUEST, executeConfig.getSaveErrors());
assertEquals("/aaa/input2.jsp", executeConfig.getInput());
String[] roles = executeConfig.getRoles();
assertNotNull(roles);
assertEquals(2, roles.length);
assertEquals("admin", roles[0]);
assertEquals("user", roles[1]);
assertEquals(3, actionMapping.getExecuteConfigSize());
assertFalse(executeConfig.isStopOnValidationError());
assertTrue(executeConfig.isRemoveActionForm());
assertEquals("reset", executeConfig.getResetMethod().getName());
assertTrue(executeConfig.isRedirect());
}
示例3: test_getSaveErrors_setSaveErrors
import org.seasar.struts.enums.SaveType; //导入依赖的package包/类
/**
* Test method for {@link A3ExecuteConfig#getSaveErrors()}.<br />
* Test method for {@link A3ExecuteConfig#setSaveErrors(SaveType)}.
*/
@Test
public final void test_getSaveErrors_setSaveErrors() {
assertEquals(SaveType.REQUEST, this.config.getSaveErrors()); // Default value is REQUEST.
assertSame(this.original.getSaveErrors(), this.config.getSaveErrors());
this.config.setSaveErrors(SaveType.SESSION);
assertEquals(SaveType.SESSION, this.config.getSaveErrors());
assertSame(this.original.getSaveErrors(), this.config.getSaveErrors());
this.config.setSaveErrors(null);
assertNull(this.config.getSaveErrors());
assertNull(this.original.getSaveErrors());
}
示例4: getSaveErrors
import org.seasar.struts.enums.SaveType; //导入依赖的package包/类
@Override
public SaveType getSaveErrors() {
return this.executeConfig.getSaveErrors();
}
示例5: setSaveErrors
import org.seasar.struts.enums.SaveType; //导入依赖的package包/类
@Override
public void setSaveErrors(SaveType saveErrors) {
this.executeConfig.setSaveErrors(saveErrors);
}
示例6: execute
import org.seasar.struts.enums.SaveType; //导入依赖的package包/类
/**
* @return
*/
@Execute(validate = "validate", saveErrors = SaveType.SESSION, input = "input.jsp")
public String execute() {
return "result.jsp";
}
示例7: processErrors
import org.seasar.struts.enums.SaveType; //导入依赖的package包/类
/**
* 検証エラーの処理を行います。
*
* @param errors
* エラーメッセージ
* @param request
* リクエスト
* @param executeConfig
* 実行設定
* @return アクションフォワード
*/
protected ActionForward processErrors(ActionMessages errors,
HttpServletRequest request, S2ExecuteConfig executeConfig) {
if (executeConfig.getSaveErrors() == SaveType.REQUEST) {
request.setAttribute(Globals.ERROR_KEY, errors);
} else {
request.getSession().setAttribute(Globals.ERROR_KEY, errors);
}
return actionMapping.createForward(executeConfig
.resolveInput(actionMapping));
}
示例8: getSaveErrors
import org.seasar.struts.enums.SaveType; //导入依赖的package包/类
/**
* エラーメッセージの保存場所を返します。
*
* @return エラーメッセージの保存場所
*/
public SaveType getSaveErrors() {
return saveErrors;
}
示例9: setSaveErrors
import org.seasar.struts.enums.SaveType; //导入依赖的package包/类
/**
* エラーメッセージの保存場所を設定します。
*
* @param saveErrors
* エラーメッセージの保存場所
*/
public void setSaveErrors(SaveType saveErrors) {
this.saveErrors = saveErrors;
}