View | Details | Raw Unified | Return to bug 15231
Collapse All | Expand All

(-)MessageTag.java (-19 / +19 lines)
Lines 188-198 Link Here
188
  public void addArg(Object arg)
188
  public void addArg(Object arg)
189
    {
189
    {
190
    _arguments.add(arg);
190
    _arguments.add(arg);
191
    if (_debug)
191
    log("added arg: " + arg.toString());
192
      {
193
      ServletContext sc = pageContext.getServletContext();
194
      sc.log("i18n:message added arg: " + arg.toString());
195
      }
196
    }
192
    }
197
193
198
  /**
194
  /**
Lines 242-257 Link Here
242
    try
238
    try
243
        {
239
        {
244
        _value = bundle.getString(key);
240
        _value = bundle.getString(key);
245
        if (_debug)
241
        log("template for " + key + " is: " + _value);
246
          {
247
          ServletContext sc = pageContext.getServletContext();
248
          sc.log("i18n: message: template for " + key + " is: " + _value);
249
          }
250
        }
242
        }
251
    catch (java.util.MissingResourceException e)
243
    catch (java.util.MissingResourceException e)
252
        {
244
        {
253
        ServletContext sc = pageContext.getServletContext();
245
        log("value not found for key:" + key);
254
        sc.log("value not found for key:" + key);
255
        }
246
        }
256
247
257
    return BodyTag.EVAL_BODY_TAG;
248
    return BodyTag.EVAL_BODY_TAG;
Lines 284-295 Link Here
284
275
285
        if ( _value == null)
276
        if ( _value == null)
286
            {
277
            {
287
            if (_debug)
278
            log("skipping null value for " + _key);
288
                {
289
                ServletContext sc = pageContext.getServletContext();
290
                String key = this.getKey();
291
                sc.log("i18n: message: skipping null value for " + key);
292
                }
293
            }
279
            }
294
        else if (id != null)
280
        else if (id != null)
295
            {
281
            {
Lines 310-315 Link Here
310
    // only process the body once
296
    // only process the body once
311
    return BodyTag.EVAL_PAGE;
297
    return BodyTag.EVAL_PAGE;
312
    }
298
    }
313
299
  
300
  /**
301
   * log a message to the servlet context log if we are in
302
   * debug mode (otherwise, do nothing).
303
   * @param message the message to log
304
   */
305
  private void log(String message)
306
    {
307
    if (_debug)
308
      {
309
        ServletContext sc = pageContext.getServletContext();
310
        sc.log("i18n:message: " + message);
311
      }
312
    }
313
  
314
314
315
  } // MessageTag
315
  } // MessageTag

Return to bug 15231