本文整理汇总了Java中org.apache.commons.validator.Field.getMsg方法的典型用法代码示例。如果您正苦于以下问题:Java Field.getMsg方法的具体用法?Java Field.getMsg怎么用?Java Field.getMsg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.validator.Field
的用法示例。
在下文中一共展示了Field.getMsg方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getActionMessage
import org.apache.commons.validator.Field; //导入方法依赖的package包/类
/**
* Gets the <code>ActionMessage</code> based on the
* <code>ValidatorAction</code> message and the <code>Field</code>'s
* arg objects.
* @param request the servlet request
* @param va Validator action
* @param field the validator Field
*/
public static ActionMessage getActionMessage(
HttpServletRequest request,
ValidatorAction va,
Field field) {
String args[] =
getArgs(
va.getName(),
getMessageResources(request),
RequestUtils.getUserLocale(request, null),
field);
String msg =
field.getMsg(va.getName()) != null
? field.getMsg(va.getName())
: va.getMsg();
return new ActionMessage(msg, args);
}
示例2: getActionError
import org.apache.commons.validator.Field; //导入方法依赖的package包/类
/**
* Gets the <code>ActionError</code> based on the
* <code>ValidatorAction</code> message and the <code>Field</code>'s
* arg objects.
* @param request the servlet request
* @param va Validator action
* @param field the validator Field
* @deprecated Use getActionMessage() instead. This will be removed after
* Struts 1.2.
*/
public static ActionError getActionError(
HttpServletRequest request,
ValidatorAction va,
Field field) {
String args[] =
getArgs(
va.getName(),
getMessageResources(request),
RequestUtils.getUserLocale(request, null),
field);
String msg =
field.getMsg(va.getName()) != null
? field.getMsg(va.getName())
: va.getMsg();
return new ActionError(msg, args);
}
示例3: getActionMessage
import org.apache.commons.validator.Field; //导入方法依赖的package包/类
public static ActionMessage getActionMessage(
HttpServletRequest request,
ValidatorAction va,
Field field) {
MessageResources resources = Resources.getMessageResources(request);
String args[] =
Resources.getArgs(
va.getName(),
resources,
RequestUtils.getUserLocale(request, null),
field);
String msg =
field.getMsg(va.getName()) != null
? field.getMsg(va.getName())
: va.getMsg();
return new ActionMessage(msg, args);
}
示例4: getMessage
import org.apache.commons.validator.Field; //导入方法依赖的package包/类
/**
* Gets the locale sensitive message based on the
* <code>ValidatorAction</code> message and the <code>Field</code>'s
* arg objects.
* @param messages The Message resources
* @param locale The locale
* @param va The Validator Action
* @param field The Validator Field
*/
public static String getMessage(
MessageResources messages,
Locale locale,
ValidatorAction va,
Field field) {
String args[] = getArgs(va.getName(), messages, locale, field);
String msg =
field.getMsg(va.getName()) != null
? field.getMsg(va.getName())
: va.getMsg();
return messages.getMessage(locale, msg, args);
}
示例5: getMessage
import org.apache.commons.validator.Field; //导入方法依赖的package包/类
/**
* Gets the locale sensitive message based on the <code>ValidatorAction</code>
* message and the <code>Field</code>'s arg objects.
*
* @param messages The Message resources
* @param locale The locale
* @param va The Validator Action
* @param field The Validator Field
*/
public static String getMessage(MessageResources messages, Locale locale,
ValidatorAction va, Field field) {
String[] args = getArgs(va.getName(), messages, locale, field);
String msg =
(field.getMsg(va.getName()) != null) ? field.getMsg(va.getName())
: va.getMsg();
return messages.getMessage(locale, msg, args);
}
示例6: getActionMessage
import org.apache.commons.validator.Field; //导入方法依赖的package包/类
/**
* Gets the <code>ActionMessage</code> based on the
* <code>ValidatorAction</code> message and the <code>Field</code>'s arg
* objects.
* <p>
* <strong>Note:</strong> this method does not respect bundle information
* stored with the field's <msg> or <arg> elements, and localization
* will not work for alternative resource bundles. This method is
* deprecated for this reason, and you should use
* {@link #getActionMessage(Validator,HttpServletRequest,ValidatorAction,Field)}
* instead.
*
* @param request the servlet request
* @param va Validator action
* @param field the validator Field
* @deprecated Use getActionMessage(Validator, HttpServletRequest,
* ValidatorAction, Field) method instead
*/
public static ActionMessage getActionMessage(HttpServletRequest request,
ValidatorAction va, Field field) {
String[] args =
getArgs(va.getName(), getMessageResources(request),
RequestUtils.getUserLocale(request, null), field);
String msg =
(field.getMsg(va.getName()) != null) ? field.getMsg(va.getName())
: va.getMsg();
return new ActionMessage(msg, args);
}