当前位置: 首页>>代码示例>>Java>>正文


Java Field.getMsg方法代码示例

本文整理汇总了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);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:28,代码来源:Resources.java

示例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);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:30,代码来源:Resources.java

示例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);
   }
 
开发者ID:chrisekelley,项目名称:zeprs,代码行数:23,代码来源:StrutsUtils.java

示例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);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:24,代码来源:Resources.java

示例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);
}
 
开发者ID:SonarSource,项目名称:sonar-scanner-maven,代码行数:19,代码来源:Resources.java

示例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 &lt;msg&gt; or &lt;arg&gt; 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);
}
 
开发者ID:SonarSource,项目名称:sonar-scanner-maven,代码行数:31,代码来源:Resources.java


注:本文中的org.apache.commons.validator.Field.getMsg方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。